Skip to content
Mahyar Mirrashed edited this page Sep 6, 2024 · 5 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.

Clone this wiki locally