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

Remove apt lists after package installations in ubuntu containers #46

Merged
merged 1 commit into from
Oct 6, 2020
Merged

Remove apt lists after package installations in ubuntu containers #46

merged 1 commit into from
Oct 6, 2020

Conversation

aminvakil
Copy link
Contributor

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

In addition, when you clean up the apt cache by removing /var/lib/apt/lists it reduces the image size, since the apt cache is not stored in a layer. Since the RUN statement starts with apt-get update, the package cache is always refreshed prior to apt-get install.

ubuntu16                         withlists               600MB
ubuntu16                         withoutlists            570MB

@mattclay mattclay merged commit 07b78ac into ansible:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants