feat: clean up Dockerfile and reduce image size#106
Open
ikajdan wants to merge 6 commits intocollabora:mainfrom
Open
feat: clean up Dockerfile and reduce image size#106ikajdan wants to merge 6 commits intocollabora:mainfrom
ikajdan wants to merge 6 commits intocollabora:mainfrom
Conversation
ikajdan
commented
Sep 21, 2025
- Replace ADD with COPY to avoid unnecessary behaviors
- Install packages with --no-install-recommends to keep images slim
- Clean up apt lists to reduce image size
- Simplify user creation (fixes Runner user creation fails in Docker image #105)
Author
|
Hi @sjoerdsimons, any chance someone could take a look this? Since it hasn't seen activity for a while. |
Contributor
|
Please split things up in multiple commits and document your commits better e.g. |
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.
Author
|
Sorry for the delayed response. Please feel free to review the changes at your convenience. |
Author
|
@sjoerdsimons, sorry for the nudge again. When you get a chance, could you take a look at this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.