Expected Outcome
This guide describes how to lock the installed Docker version on a CentOS or RHEL host to prevent it from being upgraded during system-wide package updates. This ensures that the Docker version remains compatible with Terraform Enterprise requirements.
Prerequisites
- A running instance of Terraform Enterprise.
- A CentOS or RHEL 7/8 host.
- Root or
sudoaccess to the host. - Docker CE installed.
Use Case
Locking the Docker version is necessary to maintain a stable and supported environment for Terraform Enterprise. Following these steps ensures the installed version of Docker meets the Terraform Enterprise requirements.
Procedure
-
Install the
versionlockplugin.For RHEL 7, execute the following command.
$ yum install yum-plugin-versionlock
For RHEL 8, execute the following command.
$ yum install python3-dnf-plugin-versionlock
-
Identify installed Docker packages.
List the currently installed Docker-related packages to identify their exact version strings.
$ yum list docker-ce docker-ce-cli docker-ce-rootless-extras containerd.io --showduplicates | sort -r
The output displays the installed versions. Note the full package name and version for each component.
## Example output
docker-ce.x86_64 3:20.10.17-3.el7 @docker-ce-stable docker-ce-rootless-extras.x88_64 23.0.1-1.el7 @docker-ce-stable docker-ce-cli.x86_64 1:20.10.17-3.el7 @docker-ce-stable containerd.io.x86_64 1.6.18-3.1.el7 @docker-ce-stable ```
-
Lock the package versions.
Use the
versionlockcommand with the package versions identified in the previous step.$ yum versionlock docker-ce-20.10.17-3.el7 docker-ce-cli-20.10.17-3.el7 docker-ce-rootless-extras-23.0.1-1.el7 containerd.io-1.6.18-3.1.el7
The command returns a confirmation that the version lock was added for each package.
Loaded plugins: fastestmirror, versionlock Adding versionlock on: 0:docker-ce-rootless-extras-23.0.1-1.el7 Adding versionlock on: 1:docker-ce-cli-20.10.17-3.el7 Adding versionlock on: 3:docker-ce-20.10.17-3.el7 Adding versionlock on: 0:containerd.io-1.6.18-3.1.el7 versionlock added: 4
-
Remove the version lock (Optional).
To upgrade Docker in the future, you must first remove the lock. Execute the
versionlock clearcommand.$ yum versionlock clear