Skip to content

apt-get clean ineffective #1004

@leonard84

Description

@leonard84

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions