You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DESCRIPTION
Cleaning up the apt cache and removing /var/lib/apt/lists helps keep the image size down. Since the RUN statement starts with apt-get update, the package cache will always be refreshed prior to apt-get install. You can read more about it here: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
Note: Clean up must be performed in the same RUN step, otherwise it will not affect image size.
DESCRIPTION
Cleaning up the apt cache and removing /var/lib/apt/lists helps keep the image size down. Since the RUN statement starts with apt-get update, the package cache will always be refreshed prior to apt-get install. You can read more about it here: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
Note: Clean up must be performed in the same RUN step, otherwise it will not affect image size.
Problematic code:
RUN apt-get update && apt-get install -y python
Correct code:
RUN apt-get update && apt-get install -y python
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*
The text was updated successfully, but these errors were encountered: