1 DL3041
Moritz Röhrich edited this page 2020-11-06 20:18:51 +01: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.

Specify version with dnf install -y <package>-<version>

Problematic code:

RUN dnf install -y httpd && dnf clean all

Correct code:

RUN dnf install -y httpd-2.24.2 && dnf clean all

Rationale:

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.

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

Notes:

If you need downgrade an already installed package to an older version, use dnf downgrade -y <package_name>-<version_info>