Refactor Dockerfile with best practices#691
Merged
soxoj merged 1 commit intosoxoj:mainfrom Oct 4, 2022
Merged
Conversation
Multiple best practices applied as below: - Replace deprecated `MAINTAINER` with `LABEL maintainer` - Remove additional `apt clean` as it'll be done automatically - Use `apt-get` instead of `apt` in script, apt does not have a stable CLI interface, and it's for end-user. - Put `apt-get install` & apt lists clean up in the same command - Use `--no-install-recommends` with `apt-get install` to avoid install additional packages - Use `--no-cache-dir` with `pip install` to prevent temporary cache - Use `COPY` instead of `ADD` for files and folders - Use spaces instead of mixing spaces with tabs to indent Size change by the refactor, almost 100MB saved: ``` REPOSITORY TAG IMAGE ID CREATED SIZE maigret after 9e70c65dde32 1 minutes ago 543MB maigret before a683f2b71751 7 minutes ago 635MB ```
Owner
|
Wow, wonderful, thanks! |
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.
Multiple best practices applied as below:
MAINTAINERwithLABEL maintainerapt cleanas it'll be done automaticallyapt-getinstead ofaptin script, apt does not have a stable CLI interface, and it's for end-user.apt-get install& apt lists clean up in the same command--no-install-recommendswithapt-get installto avoid install additional packages--no-cache-dirwithpip installto prevent temporary cacheCOPYinstead ofADDfor files and foldersSize change by the refactor, almost 100MB saved: