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

apt-get clean ineffective #1004

Open
leonard84 opened this issue Mar 8, 2019 · 0 comments · May be fixed by #1147
Open

apt-get clean ineffective #1004

leonard84 opened this issue Mar 8, 2019 · 0 comments · May be fixed by #1147

Comments

@leonard84
Copy link

In the Dockerfile you try to reduce the image size by cleaning the apt caches with

  && rm -rf /var/lib/apt/lists/* \
  && apt-get -qyy clean

the problem is that this only works when it is executed in the same RUN that also uses apt-get update, otherwise the data is already baked into a previous layer and all you achive is to record it as deleted which actually increases the layer size again.

See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get

@t3easy t3easy linked a pull request Feb 7, 2020 that will close this issue
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 a pull request may close this issue.

1 participant