Skip to content
Tanmay Pereira Naik edited this page Mar 8, 2024 · 4 revisions

Pin versions in apt get install.

Problematic code:

FROM busybox
RUN apt-get install python

Correct code:

FROM busybox
RUN apt-get install python=2.7

Rationale:

https://docs.docker.com/develop/develop-images/instructions/#apt-get

Version pinning forces the build to retrieve a particular version regardless of what’s in the cache. This technique can also reduce failures due to unanticipated changes in required packages.