Loading of OCI Images in an Airgap Environment

This short paper records the steps for loading the images in an air-gapped environment of OpenShift Container Platform (OCP) 4.2.

Skopeo is the tool.

First, on the internet-facing Ubuntu server, install skopeo.

sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:projectatomic/ppa
sudo apt-get update
sudo apt-get -y install skopeo

Then, download the image into files. For all the following Rook Operator images,

docker.io/ceph/ceph:v14.2.6
docker.io/rook/ceph:master
quay.io/cephcsi/cephcsi:v2.0.0
quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
quay.io/k8scsi/csi-resizer:v0.4.0
quay.io/k8scsi/csi-provisioner:v1.4.0
quay.io/k8scsi/csi-snapshotter:v1.2.2
quay.io/k8scsi/csi-attacher:v2.1.0

copy the image from the remote registry into a local directory,

skopeo copy docker://{{ .img }} dir:{{ .dir }}

Sample:

skopeo copy docker://docker.io/ceph/ceph:v14.2.6 dir:/tmp/images/ceph:v14.2.6

Then transfer all the files, into the bastion node of OCP.

Finally, we can load the image into the worker nodes. The Go template {{ .worker }} denotes the worker node’s name or IP.

scp -r /tmp/images core@{{ .worker }}:/tmp

For each of the images required, copy it into the OCI container storage.

ssh core@{{ .worker }} skopeo copy dir:/tmp/images/ceph:v14.2.6 containers-storage:docker.io/ceph/ceph:v14.2.6

Now we have all the required images loaded into OCI container storage.