5 DL3008
Mahyar Mirrashed edited this page 2024-09-05 20:21:31 -07:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 whats in the cache. This technique can also reduce failures due to unanticipated changes in required packages.