Revamp Dockerfile#183
Merged
demenech merged 3 commits intofeat/dockerhub-deprecation-warningfrom Jan 8, 2025
Merged
Conversation
Using a couple best practices for saving space and build cache optimizations to get better build times and much smaller final image. Notably: - Python packages are now kept in a virtual environment, which is fully prepared in the builder stage, later simply copied to the same path of the final image - Any python cache .pyc files are not part of the final image - Git binary needed to automatically determine the package version is not part of the final image - Many auxiliary project source files (incl. the local .git dir(!)) are also omitted from the final image - Use RUN --mount instead of COPY where the files are needed only for the command - Keep various COPY operations to the end of a stage not to invalidate semantically unrelated cached layers - Remove deprecated (and misplaced) MAINTAINER directive in favor of a particular "authors" LABEL
Collaborator
|
Let's go ahead and merge this, but I think ultimately I'd prefer to use |
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.
Hello folks,⚠️ this PR actually targets the original PR branch).
Being under a bit of time pressure, I wanted to get this done ASAP, which turned out to be before you got to review the PR #181 (so the change is built upon it and
I said I don't want to work on these improvements before that PR is resolved, but then again, I felt there's so much to improve - and indeed, I manged to shrink the new image size to a half of the original - that I wouldn't want to hold this effort any longer.
All the Dockerfile changes are in fact rather cosmetic and don't change any ARGs (only sorts them to the start of a stage). Same with ENTRYPOINT and CMD directives, which remain the same.
See the commit messages for details. Thank you!