-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): Cut docker image size down to a half
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
- Loading branch information
1 parent
02e41c0
commit 6d70618
Showing
1 changed file
with
89 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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