In the following post, we are going to talk about creating an offline container base registry.
Prerequisites
- Linux Operating System ( in the further steps example of this post, we are going to use Fedora Linux 36 (Workstation Edition) ).
- The host should have internet connectivity
Offiline registry
Step 1. Installing podman
For other type of Linux Operating System check the Podman docs for the right command.
Step 2. Creating the application directory
of the offline registry
Step 3. Installing the htpasswd
Step 4. Creating the username:password
of the offline registry
Note, that the username
and password
should be replaced with the values you are going to use for your environment.
Step 5. Creating the offline self-signed certificate.
In order to validate the trust certificats use the following command
Step 6. Creating the registry container
Step 7. Make sure that the firewall is having the port 5000
open
Step 8. Manage the ocpdiscon-registry
container with systemd
Step 9. Download the openshift-cli-client
Go to the Download Openshift CLI for linux to download the oc-cli-client
for linux.
Step 10. Download the pull-secret
Go to the Download Openshift pull-secret to download the pull-secret file. Once you obtain the file check the following command to
Step 11. Modifying pull-secret
file for offline-registry use
The following /apps/registry/pull-secret.json
content would follow the following template:
Now we should add the section that describes the credentials to the offline registry:
Replace the with the output from the following command `echo -n username:password | base64 -w0`.
In the end the pull-secret.json
should follow the following template:
Step 12. Login to the offline registry
Step 13. Mirroring OCP container base images to the offline registry
Step 14. ICSP.yaml and install-config.yaml
Once the container base image mirroring will be finished, you will be promt with the following message:
To use the new mirrored repository to install, add the following section to the install-config.yaml:
Save this information for later use. For more information you can check Openshift Documentation.
Step 15. Validating the mirroring