You use the Docker CLI to pull images from Oracle Cloud Infrastructure Registry.
Your permissions control the images you can pull from Oracle Cloud Infrastructure Registry. You can pull images from repositories you've created, from public repositories, and from repositories that the groups to which you belong have been granted access by identity policies. If you belong to the Administrators group, you can pull images from any repository in the tenancy.
To pull images from Oracle Cloud Infrastructure Registry using the Docker CLI:
If you already have an auth token, go to the next step. Otherwise:
- In the top-right corner of the Console, open the User menu () and then click User Settings to view the details.
- On the Auth Tokens page, click Generate Token.
- Enter a friendly description for the auth token. Avoid entering confidential information.
- Click Generate Token. The new auth token is displayed.
- Copy the auth token immediately to a secure location from where you can retrieve it later, because you won't see the auth token again in the Console.
- Close the Generate Token dialog.
In a terminal window on the client machine running Docker, log in to Oracle Cloud Infrastructure Registry by entering
docker login <region-code>.ocir.io, where
<region-code>corresponds to the code for the Oracle Cloud Infrastructure Registry region you're using. For example,
docker login iad.ocir.io. See Availability by Region Name and Region Code for the list of region codes.
- When prompted, enter your username in the format
<tenancy-namespace>/<username>. For example,
firstname.lastname@example.org. If your tenancy is federated with Oracle Identity Cloud Service, use the format
- When prompted, enter the auth token you copied earlier.
Pull the Docker image from Oracle Cloud Infrastructure Registry to the client machine by entering:
docker pull <region-code>.ocir.io/<tenancy-namespace>/<repo-name>/<image-name>:<tag>
<region-code>is the code for the Oracle Cloud Infrastructure Registry region you're using. For example,
iad. See Availability by Region Name and Region Code for the list of region codes.
ocir.iois the Oracle Cloud Infrastructure Registry name.
<tenancy-namespace>is the auto-generated namespace string of the tenancy that owns the repository from which you want to pull the image. For example, the namespace of the acme-dev tenancy might be
ansh81vru1zp. Note that for some older tenancies, the namespace string might be the same as the tenancy name in all lower-case letters (for example,
acme-dev). Note also that your user must have access to the tenancy.
<repo-name>(optional) is the name of a repository from which you want to pull the image (for example,
project01). Note that your user must have access to the repository. Omit this argument if the image does not exist within a repository (see About Repositories).
<image-name>is the name of the image that you want to pull from Oracle Cloud Infrastructure Registry (for example,
<tag>is the tag of the image that you want to pull from Oracle Cloud Infrastructure Registry (for example,
docker pull iad.ocir.io/ansh81vru1zp/project01/acme-web-app:version2.0.test
Note that if you don't specify a
docker pullcommand, Docker pulls the image that has the
Confirm that the image has been pulled from Oracle Cloud Infrastructure Registry by entering
docker imagesand verifying that the list of images on the client machine now includes the image you just pulled.
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE iad.ocir.io/ansh81vru1zp/project01/acme-web-app version2.0.test 8e0506e14874 1 minute ago 162.6 MB acme-web-app latest 8e0506e14874 2 hours ago 162.6 MB acme-web-app version1.0 7d9495d03763 2 hours ago 162.6 MB <none> <none> 6ebd328f833d 5 hours ago 162.6 MB hello-world latest 80b84820d442 5 weeks ago 890 B