Skip to content
mengfung.com
writing

Docker: apt-get cleanup

 ·  1 min read

If you install things with apt-get remember to clean it up afterwards

RUN apt-get clean && rm -f /var/lib/apt/lists/*_*

This would be a better way:

RUN apt-get update -y \
&& apt-get install -y -q package1 \
package2 \
package3 \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*