Using air-gapped or sanctioned images to avoid pulling images from the internet is another use case and described here.
MySQL Operator for Kubernetes requires these three container images to function: MySQL Operator for Kubernetes, MySQL Router, and MySQL Server.
Choose the desired MySQL Operator for Kubernetes version. For example, latest is defined in helm/mysql-operator/Chart.yaml. For example,
docker pull container-registry.oracle.com/mysql/community-operator:VERSIONwhere VERSION is the desired MySQL Operator for Kubernetes version.
docker save container-registry.oracle.com/mysql/community-operator:VERSION -o mysql-operator.tarto export the container image where VERSION is the desired MySQL Operator for Kubernetes version.
mysql-operator.tarto a host with access to the private registry.
docker load -i mysql-operator.yamlto load the image into the local Docker cache on that host.
docker tag mysql/mysql-server:VERSION registry:port/repo/mysql-server:VERSIONto retag the image as preparation for pushing to the private registry; adjust VERSION accordingly.
docker push registry:port/repo/mysql-server:VERSIONto push the newly created tag to the private registry; adjust VERSION accordingly.
If you won't need the image from the importing host cache, then you can delete it with
docker rmi mysql/mysql-operator:VERSION registry:port/repo/mysql-server:VERSION. This removes it from the host but the registry itself won't be affected. Adjust VERSION accordingly.
Alternatively, you can use the following commands to pull and push in one command. Execute it on a host with Oracle Container Registry (OCR) access. If applicable, this host also needs access to the secure (bastion) host that can access the private registry. Modify the variable values to fit your needs. The command does not consume local space for a tarball but will stream the container image over SSH.
export BASTION_USER='k8s' export BASTION_HOST='k8' export REGISTRY="..." # for example 192.168.20.199:5000 export REPOSITORY="..." # for example mysql export OPERATOR_VERSION=$(grep appVersion helm/mysql-operator/Chart.yaml | cut -d '"' -f2) docker pull container-registry.oracle.com/mysql/community-operator:$OPERATOR_VERSION docker save container-registry.oracle.com/mysql/community-operator:$OPERATOR_VERSION | \ ssh $BASTION_USER@$BASTION_HOST \ "docker load && \ docker tag container-registry.oracle.com/mysql/community-operator:$OPERATOR_VERSION $REGISTRY/$REPOSITORY/mysql-operator:$OPERATOR_VERSION && \ docker push $REGISTRY/$REPOSITORY/mysql-operator:$OPERATOR_VERSION && \ docker rmi container-registry.oracle.com/mysql/community-operator:$OPERATOR_VERSION $REGISTRY/$REPOSITORY/mysql-operator:$OPERATOR_VERSION" docker rmi container-registry.oracle.com/mysql/community-operator:$OPERATOR_VERSION