Skip to content

feat: clean up Dockerfile and reduce image size#106

Merged
sjoerdsimons merged 7 commits intocollabora:mainfrom
ikajdan:main
Mar 29, 2026
Merged

feat: clean up Dockerfile and reduce image size#106
sjoerdsimons merged 7 commits intocollabora:mainfrom
ikajdan:main

Conversation

@ikajdan
Copy link
Copy Markdown
Contributor

@ikajdan 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)
  • Switch base images to Debian trixie

@ikajdan
Copy link
Copy Markdown
Contributor Author

ikajdan commented Nov 23, 2025

Hi @sjoerdsimons, any chance someone could take a look this? Since it hasn't seen activity for a while.

@sjoerdsimons
Copy link
Copy Markdown
Contributor

Please split things up in multiple commits and document your commits better e.g. Replace ADD with COPY to avoid unnecessary behaviors -> explain what the unecessary behaviours are you're avoiding.

Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated
@ikajdan
Copy link
Copy Markdown
Contributor Author

ikajdan commented Dec 21, 2025

Sorry for the delayed response. Please feel free to review the changes at your convenience.

@ikajdan ikajdan requested a review from sjoerdsimons December 21, 2025 22:16
@ikajdan
Copy link
Copy Markdown
Contributor Author

ikajdan commented Feb 5, 2026

@sjoerdsimons, sorry for the nudge again. When you get a chance, could you take a look at this?

@obbardc
Copy link
Copy Markdown
Contributor

obbardc commented Mar 23, 2026

Could upgrade docker image to trixie too.

@ikajdan
Copy link
Copy Markdown
Contributor Author

ikajdan commented Mar 23, 2026

Could upgrade docker image to trixie too.

Done. Also pinned the images to their corresponding digests instead of using tags.

Copy link
Copy Markdown
Contributor

@obbardc obbardc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated
Copy link
Copy Markdown
Contributor

@sjoerdsimons sjoerdsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks fine to me, just the container tags to change

Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated
ikajdan added 7 commits March 28, 2026 23:19
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.
@ikajdan
Copy link
Copy Markdown
Contributor Author

ikajdan commented Mar 28, 2026

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.

@ikajdan ikajdan requested a review from sjoerdsimons March 28, 2026 22:27
Copy link
Copy Markdown
Contributor

@obbardc obbardc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@sjoerdsimons sjoerdsimons added this pull request to the merge queue Mar 29, 2026
Merged via the queue into collabora:main with commit 04fe11e Mar 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Runner user creation fails in Docker image

3 participants