Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't build caches into Docker images #4537

Merged
merged 2 commits into from
Sep 25, 2017

Conversation

mboersma
Copy link
Member

@mboersma mboersma commented Sep 24, 2017

Adds flags to pip and apk commands in the Dockerfiles to prevent those tools from creating cache data which gets built into the Docker images.

YMMV in terms of space savings, but not caching these items is generally considered a best practice for containers.

$ git checkout master && docker build -t azure-cli:before .
$ git checkout dont-cache-inside-docker-image && docker build -t azure-cli:after .
$ docker images
REPOSITORY         TAG       IMAGE ID            CREATED             SIZE
azure-cli          before    408d8e5affc2        3 days ago          500MB
azure-cli          after     285a1d5f2499        3 days ago          482MB

@msftclas
Copy link

@mboersma,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@mboersma mboersma changed the title Dont cache inside docker image Don't build caches into Docker images Sep 24, 2017
@troydai
Copy link
Contributor

troydai commented Sep 25, 2017

Looks good to me. @derekbekoe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants