You should not use OS package manager update instructions such as
apt-get update or
yum update either alone or in a single line in the Dockerfile.
Adding update instructions in a single line on the Dockerfile will cause the update layer to be cached. When you then build any image later using the same instruction, this will cause the previously cached update layer to be used, potentially preventing any fresh updates from being applied to later builds.
Updated 7 months ago