This repository was archived by the owner on Feb 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Optimize image, reduce docker image size by 11GB #13
Open
thomasnordquist
wants to merge
6
commits into
uber-archive:master
Choose a base branch
from
thomasnordquist:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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
travis failed since docker was run with
|
alrosot
added a commit
to alrosot/android-build-environment
that referenced
this pull request
Apr 9, 2017
alrosot
approved these changes
Apr 10, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on a separate branch
This seems like an great improvement. Any chance this will be merged? |
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 update
was 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/