Sunday, January 5, 2025

OpenShift - Private Registry configuration

 

Private Registry Diagram:

#yum install container-tools -y

* It will install the podman, skopeo and buildah packages.
Default configuration path: /etc/containers/registries.conf

unqulified-search-registries = ["Private Registry host"]
insure = true
blocked = false
location = "private registry host"

* Create a local user for login into private registry hub.
#mkdir /var/lib/containers/registry
#podman run -d --name registry --privileged -v /var/lib/containers/registry:/var/lib/registry -p 5000:5000 --restart=always
#cd /var/lib/containers/registry
#podman pull registry.access.redhat.com/rhscl/httpd-24-rhel7
*Tag the images from registry.
#podman tag registry.access.redhat.com/rhscl/httpd-24-rhel7 private_registry_host:5000/prod/rhel7
#podman push egistry.access.redhat.com/rhscl/httpd-24-rhel7

* We can able to copy an image from docker through skopeo command
#skopeo copy docker://docker.io/redhat/ubi8-minimal  docker://Private_registry_host:5000/prod

buildah is a tool which we can build a image as per our requirement.

#buildah ps
#buildah from fedora [fetch a base image]
#buildah exec -it fedora-working-container bash [access the container]
#buildah images
#buildah run fedora-working-container dnf install httpd [install the pacakge]
#echo "Welcome to Internet world" > index.html [create a web config file]
#buildah copy fedora-working-container index.html > /var/www/html/index.html
#buildah config --entrypoint "/usr/sbin/httpd -DFOREGROUND" fedora-working-container 
#buildah cmd "/usr/sbin/httpd -DFOREGROUND" fedora-working-container
#buildah run "/usr/sbin/httpd -DFOREGROUND" fedora-working-container
#buildah config --entrypoint "/usr/sbin/httpd -DFOREGROUND" fedora-working-container

#buildah commit fedora-working-container myapp

#buildah images

No comments:

Post a Comment