If you use a private registry, you need to use Docker login to push and pull images to and from Container Registry. For this, you can use your Container Registry username but you need to generate your CLI login for Docker first.
docker login your-subdomain.container-registry.com -u USER_NAME -p CLI
Inside your Container Registry instance, you can have two types of “folders” to sort your artifacts and control user access. Projects are bigger ones and contain repositories, the smaller folders. User access is managed on the project level.
Upon your first registration, a sample public project called library already exists in your Container Registry instance.
You can pull and push your images from or into it. Alternatively, you can create your own public or private project following the instructions from this tutorial.
A fully qualified repository name includes a project and repository name and is used on the next step.
You can pull or push your images from/into an existing repository inside your project or create a new repository while pushing an image to Container Registry.
Tag the image you want to push; use the qualified name of your repository as repository and some tag as tag:
docker tag SOURCE_IMAGE[:TAG] your-subdomain.container-registry.com/library/repository[:TAG]
You can also build a new image with a tag:
docker build -t SOURCE_IMAGE[:TAG] -t your-subdomain.container-registry.com/library/repository[:TAG]
Push the image using its tag to Container Registry:
docker push your-subdomain.container-registry.com/library/repository[:TAG]
In case of success, you will see the Docker image’s ID in your command line tool and in your project repository in Container Registry, under the Artifacts section together with the push timestamp like this:
To make pushing images easier for you, we prepared the sample tag and push commands that you can access through the GUI. You only need to change the source image tag and the final tag which you what to use in your Container Registry.
Inside the project, click on the PUSH COMMAND as shown on the screenshot:
docker pull your-subdomain.container-registry.com/library/repository:TAG
You can pull images using their tags or SHA265 hashes (digests). The hashes are more reliable since tags do not catch all changes in image layers.
In the Container Registry GUI, open the project, then the registry. You will see the list of artifacts.
Click on the copy icon in the Pull command column next to an artifact to get a pull command with the hash. If you already have the same image on your PC, they will be matched and the Image is up to date status will be shown in your command line tool.
Example pull comand:
docker pull your-subdomain.container-registry.com/library/repository@sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792
If you do not know the exact tag, go to your Container Registry account, open the project and the repository, and look for the image you need. The tag is displayed next to it, as well as information about when it was pushed. Annotations and labels can also provide you with a hint.
Click on the image to get to the overview of its tags and click on the Pull command icon next to a tag to copy the following command into clipboard:
docker pull your-subdomain.container-registry.com/library/repository:TAG