feat: clean up Dockerfile and reduce image size#106
feat: clean up Dockerfile and reduce image size#106sjoerdsimons merged 7 commits intocollabora:mainfrom
Conversation
|
Hi @sjoerdsimons, any chance someone could take a look this? Since it hasn't seen activity for a while. |
|
Please split things up in multiple commits and document your commits better e.g. |
|
Sorry for the delayed response. Please feel free to review the changes at your convenience. |
|
@sjoerdsimons, sorry for the nudge again. When you get a chance, could you take a look at this? |
|
Could upgrade docker image to trixie too. |
Done. Also pinned the images to their corresponding digests instead of using tags. |
obbardc
left a comment
There was a problem hiding this comment.
Looks good to me; just not sure about container tag. Think relying on specific tag is quite limiting; not sure what benefit it has to me.
sjoerdsimons
left a comment
There was a problem hiding this comment.
Overall looks fine to me, just the container tags to change
Remove the DEBIAN_FRONTEND=noninteractive argument from both build and runtime stages of the Dockerfile. This argument is unnecessary in this context and can be omitted to simplify the Dockerfile.
Install build-time and runtime dependencies with --no-install-recommends to prevent pulling in unnecessary packages. This reduces the final image size and build time bandwidth usage.
Use apt-get consistently and remove /var/lib/apt/lists after installing runtime packages to avoid leaving behind package index files. This reduces the final image size.
Replace adduser with explicit groupadd and useradd commands to define the user and group IDs directly. This makes user creation more predictable.
Use COPY instead of ADD when copying the build context into the image. Using COPY is better here because it provides strictly predictable behavior by copying the build context verbatim, avoiding implicit archive extraction or remote downloads.
Add a trailing slash to the COPY destination to indicate a directory target and remove redundant whitespace from the ENTRYPOINT array.
|
To me, the main reason for using digests is to have stricter control over what's inside the image. Though I understand it significantly increases maintenance effort, thus I reverted this change. |
Uh oh!
There was an error while loading. Please reload this page.