Maintaining CentOS 7 Past EOL: Using Vault Repositories and Yum Config for Docker Images
CentOS 7 reached its end of life (EOL) on June 30, 2024. However, there may be situations where you need to continue using CentOS 7 hosts for your services. This article will guide you through the process of maintaining CentOS 7 past EOL by utilizing vault repositories and configuring the yum configuration for Docker images.
What is End of Life (EOL)?
End of Life (EOL) is a term used to describe the point at which a software product, like an operating system, is no longer supported by its vendor. This means that there will be no more security updates, bug fixes, or new features released for that product. Continuing to use an EOL operating system can expose your system to security vulnerabilities and potential downtime.
Using Vault Repositories for CentOS 7
Vault repositories are archived repositories that contain the packages for EOL versions of CentOS. You can use these repositories to continue updating your CentOS 7 hosts past EOL. To use the vault repository, you need to add it to your yum configuration.
Adding the Vault Repository
To add the vault repository, you can use the following command:
sudo tee /etc/yum.repos.d/CentOS-Vault.repo <<-E '
[centos-vault]
name=CentOS-$releasever - $basearch - Vault
baseurl=http://vault.centos.org/$contentdir/$basearch/os/$releasever/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
enabled_metadata=1
'
This command will create a new yum repository file called CentOS-Vault.repo in the /etc/yum.repos.d/ directory. The repository will be enabled by default, allowing you to install packages from it.
Configuring Yum for Docker Images
Docker images are built using the packages from the yum repository. To ensure that your Docker images are built using the packages from the vault repository, you need to configure yum to use the vault repository when building Docker images.
Creating a Yum Config File for Docker
To create a yum config file for Docker, you can use the following command:
sudo tee /etc/docker/centos7-vault.json <<-E '
{
"baseurl": "http://vault.centos.org/$contentdir/$basearch/os/$releasever/",
"gpgcheck": true,
"gpgkey": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7",
"enabled": true,
"enabled_metadata": true
}
'
This command will create a new yum config file called centos7-vault.json in the /etc/docker/ directory. The config file will be used by Docker to configure yum when building Docker images.
Configuring Docker to Use the Yum Config File
To configure Docker to use the yum config file, you need to add the following line to the Docker daemon configuration file:
sudo tee /etc/docker/daemon.json <<-E '
{
"builder": {
"yum": {
"config": "/etc/docker/centos7-vault.json"
}
}
}
'
This command will add a new configuration option to the Docker daemon configuration file that specifies the path to the yum config file. Docker will use this config file when building Docker images to configure yum.
Troubleshooting OpenSSL and OpenJDK Package Installations
When installing packages like OpenSSL and OpenJDK on CentOS 7 past EOL, you may encounter issues due to missing dependencies or outdated packages. To troubleshoot these issues, you can use the following steps:
- Check the dependencies of the package using the
yum deplistcommand. - Install any missing dependencies using the
yum installcommand. - If the package is still not installing, try installing it from a different repository using the
yum installcommand with the--enablerepooption.
- CentOS 7 reached its end of life (EOL) on June 30, 2024.
- Vault repositories contain the packages for EOL versions of CentOS.
- To use the vault repository, you need to add it to your yum configuration.
- To configure yum for Docker images, you need to create a yum config file and add it to the Docker daemon configuration file.
- To troubleshoot package installations, you can check the dependencies, install missing dependencies, and try installing the package from a different repository.
References
- CentOS Vault: https://wiki.centos.org/SpecialInterestGroup/Vault
- Docker Daemon Configuration: https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
- Yum Command Manual: https://man7.org/linux/man-pages/man8/yum.8.html