Skip to the content.

Home

Oracle Cloud Infrastructure (OCI) Container Registry

Introduction

Create Registry (Optional)

It would be automatically created based on image tag (while pushing)

Registry created.

Get Auth Token

Auth token created

paste the token in notepad.

Docker login

docker login <region-code>.ocir.io

Ger region codes from here

When prompted, enter your username in the format {tenancy_name}/{username}. For example, demo/nadeem.mohammad@xyz.com.

If your tenancy is federated with Oracle Identity Cloud Service, use the format {tenancy-name}/oracleidentitycloudservice/{username}.

User name : demo/oracleidentitycloudservice/nadeem.mohammad@xyz.com

Password : enter the auth token you copied earlier

Docker Push

you might want to group together multiple versions of the demo-web-app image in the demo tenancy in the Frankfurt region into a repository called docker-registry as follows

fra.ocir.io/demo/docker-registry/demo-web-app:4.6.3

in the following format

{region-code}.ocir.io/{tenancy-name}/{repo-name}/{image-name}:{tag}

Refer this for more details

No Images

D:\>docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
D:\>

Note

Pull An Image

Lets create a docker image

D:\>docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
697743189b6d: Pull complete
Digest: sha256:061ca9704a714ee3e8b80523ec720c64f6209ad3f97c0ff7cb9ec7d19f15149f
Status: Downloaded newer image for busybox:latest

D:\>
D:\>docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             latest              d8233ab899d4        6 weeks ago         1.2MB

D:\>

Tag it.

To push an image to a private registry and not the central Docker registry you must tag it with the registry hostname and port (if needed). More on tagging

D:\>docker tag busybox:latest fra.ocir.io/demo/docker-registry/docker-test:1.0

D:\>

Image tagged

D:\>docker images
REPOSITORY                                    TAG                 IMAGE ID            CREATED             SIZE
busybox                                       latest              d8233ab899d4        6 weeks ago         1.2MB
fra.ocir.io/demo/docker-registry/docker-test   1.0                 d8233ab899d4        6 weeks ago         1.2MB

D:\>

Push to OCI Registry

D:\>docker push fra.ocir.io/demo/docker-registry/docker-test:1.0
The push refers to repository [fra.ocir.io/demo/docker-registry/docker-test]
adab5d09ba79: Pushed
1.0: digest: sha256:4415a904b1aca178c2450fd54928ab362825e863c0ad5452fd020e92f7a6a47e size: 527

D:\>

Image pushed

If required you can execute the following command to pull the image

docker pull fra.ocir.io/demo/docker-registry/docker-test:1.0

Next

Lets push the Hello Docker Image into OCI Regitry

References