Yum Configuration on Container

Atul Nikade
3 min readDec 9, 2021

what is a container?

The container is the virtual os that can work as a real operating system. The aim of using containerization technology is to save time. and avoid the expenses of physical devices.

Steps to configure yum on container:

step 1: start the docker with the following command. “systemctl start docker” and check the docker is started or not to check this you can use the command “systemctl status docker”.

step 2: create a volume and get the mountpoint address of that. command to create a volume is “docker volume create volume_name” and to see the complete information of the volume command is “docker volume inspect volume_name”.

step 3: to see the information of the home file system use the command “df -h” and mount the DVD of that file using the command “mount dev/sr0 /var/lib/docker/volumes/room/_data”.

step 4: go to the mountpoint address of the volume and see inside the folder by using the ls command. you will get two folders AppStream and BaseOS then go then create one container and attach the created volume to it. command to go to the mountpoint is

“cd /var/lib/docker/volumes/room/_data” and command to create a container and attach the volume to it “docker run -it — name container_name -v volume_name:/dvd image_name:version”.

step 5: go to the path “cd /etc/yum.repos.d” and delete all the pre-created repositories. In container name of the yum repository is case-sensitive. command to delete the pre-created repo is “rm *.repo.”

step 6: after deleting all the repositories go to the path “cd /dvd” and inside dvd folder AppStream folder will be there go inside the AppStream folder and copy the path of that folder again go to “cd /etc/yum.repos.d” and create one file and paste the path in that file and save the file with this name “Centos-my.repo”.

step 7: now type the command “yum repolist” to see the repo files and now you can install the libraries on container.

Thank you for reading…!

--

--