docker-squash ftw! #199
docker-squash ftw! #199
Conversation
ad159b8
to
ecb8bb3
ecb8bb3
to
2bf773e
2bf773e
to
bd9c029
|
This approach utilized Notes:
The final docker image weights around 350Mb, of which the 120Mb is the python base image and the rest is masterfirefoxos code + dependencies. My concern with both #198 and this approach is that on every python dependency change the amount of data contributors have to download is bigger than the current size. This is not a problem for this project but something to keep in the back of our minds for other projects. @jgmize comments, ideas, questions? |
|
I like this approach; I think it has some real potential, and I really appreciate your detailed explanations in this PR and in #198. :)
If a contributor is building images locally from the dockerfile because they're adding new dependencies, then they'll still have caching of previously built layers. I think we might want to also consider creating a separate squashed "base image" that only includes the installed dependencies, and leaves out the |
| @@ -12,6 +12,10 @@ pip install fig | |||
|
|
|||
| FIG_CMD="fig --project-name jenkins${JOB_NAME}${BUILD_NUMBER} -f ./bin/jenkins/fig.yml" | |||
|
|
|||
| $FIG_CMD build | |||
|
|
|||
| docker save `echo jenkins${JOB_NAME}${BUILD_NUMBER}| sed s/_//g`_web | sudo docker-squash -t `echo jenkins${JOB_NAME}${BUILD_NUMBER}| sed s/_//g`_web | docker load | |||
jgmize
Jun 18, 2015
Contributor
I think some judicious use of escaped newlines would help the readability here ;)
Also, would you mind filing a PR to https://github.com/mozilla/webprod-jenkins to install docker-squash?
I think some judicious use of escaped newlines would help the readability here ;)
Also, would you mind filing a PR to https://github.com/mozilla/webprod-jenkins to install docker-squash?
|
OK I test-deployed this pr and works fine. I'm going to merge this and PR against webprod-jenkins with docker-squash updates too. |
…quash-method docker-squash ftw!
Current docker image size ~600mb
After docker-squash ~350mb
See also http://jasonwilder.com/blog/2014/08/19/squashing-docker-images/