The line RUN yum update -y in centos.Dockerfile introduces a potential mismatch between the VM image and the container image. Performing a system update directly in the Dockerfile can lead to unexpected behavior and inconsistencies.
Instead of updating packages by default, remove RUN yum update -y from the Dockerfile. This ensures a more predictable environment, making the resulting image closer to the VM configuration. If users require additional updates or specific packages, they should install them explicitly in their own container images.