Write a Comment

Comment

  1. It doesn’t make sense to run “apt-get remove” and other cleanup commands on different “RUN” lines, because every “RUN” command creates a different docker layer and keeps all the unnecessary files in it. Do all the software installation and cleanup in one run, it’ll save a few dozen MB’s in image size. Like this:
    RUN apt update && apt install rsyslog -y && apt-get remove -y git && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*