Most major distributions often release a new base image, which includes the latest critical updates and security fixes as needed. This means that you can simply pull out the last base image to get these corrections and restore your image.
But also, since your containers use yum, you can use yum to manage the packages you are updating. Yum lets you install a release version so that you can bind your updates to a specific OS version.
For example, if you are using RHEL 7.2, you might have a Docker file that looks something like this:
FROM rhel:7.2 RUN echo "7.2" > /etc/yum/vars/releasever RUN yum update -y && yum clean all
This ensures that you stay on RHEL 7.2 and receive only critical package updates, even if you perform a full yum update.
For more information on the available yum variables or other configuration options, simply browse the yum.conf man page.
In addition, if you need finer control over updates, you can check out the yum-plugin-versionlock package, but this more than likely overwhelms your needs.
source share