This repository was archived by the owner on Feb 15, 2018. It is now read-only.
Optimize image, reduce docker image size by 11GB#13
Open
thomasnordquist wants to merge 6 commits into
Open
Conversation
This will greatly reduce the final docker image size. (by 678 MB)
This will greatly reduce the final docker image size. (by 2.61GB)
apt-get update is called a few lines below. This layer won't save any disk space
There are no more packages left, they were cleaned in the layers, they have been downloaded in
The previous usage of `chown` and `chmod` lead to two layers which modified all downloaded files, each layer adding 3.6GB to the docker image. (Total of 7.2 GB) Build time is now much shorter, since the files won't be copied to a new layer. Also: - Move user creation to top - Move environmentals to top
Author
|
travis failed since docker was run with |
alrosot
added a commit
to alrosot/android-build-environment
that referenced
this pull request
Apr 9, 2017
|
This seems like an great improvement. Any chance this will be merged? |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The changes only consist of structural changes,
the build environment itself has not been altered.
What has been achieved by the changes:
Clear
/var/lib/apt/lists/in the same layerapt-get updatewas invoked:https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run
Optimize for image size:
https://blog.replicated.com/engineering/refactoring-a-dockerfile-for-image-size/