Trim down the docker image size - #55
Open
pkonieczny wants to merge 1 commit into
Open
Conversation
jairideout
approved these changes
Aug 26, 2026
| # chown has to be run in the same command otherwise the files are copied in the next docker layer | ||
| RUN pip install --no-cache-dir -U pip && \ | ||
| pip install --no-cache-dir -q -r /root/requirements.txt && \ | ||
| rm -rf /usr/local/lib/python3.13/site-packages/biom/tests && \ |
Contributor
There was a problem hiding this comment.
Are there other tests we could remove, e.g. scikit-bio's?
Contributor
Author
There was a problem hiding this comment.
Yes, but they're not that big - I figured simplicity wins over chipping away more tiny pieces 🤷
| ENV DEBIAN_FRONTEND noninteractive | ||
| RUN apt-get update && apt-get install -yq --no-install-recommends \ | ||
| apt-transport-https \ | ||
| build-essential \ |
Contributor
There was a problem hiding this comment.
Can you confirm with @clausmith @lynchde on the wheel-only change?
| # jupyter_contrib_nbextensions imports pkg_resources, which setuptools removed | ||
| # in v81; the python:3.13-slim base image no longer ships setuptools at all. | ||
| setuptools<81 | ||
| awscli |
Contributor
There was a problem hiding this comment.
I wonder why we had this as a dependency
Contributor
Author
There was a problem hiding this comment.
I vaguely remember at one point the main container uploading the ipynb file. It's now done in a sidecar that has a different image with awscli.
audy
approved these changes
Aug 26, 2026
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.
This PR trims down the size of the docker image from ~3.8GB to ~1.2GB. Out of the remaining size, >1GB are the Python packages that we probably want to keep around.
The image could be further trimmed a bit but not without consequence (e.g. slower package loading on start). Let's only get to that if we deem it necessary.
Note: this PR removes the compilers and their tooling (~600MB) from the image so only Python packages with wheels can be installed, if a package requires compilation, it will fail the
pip install.