OCI Container Registry Introduction

The OCI Container Registry (Registry) allows you to store private and public container repositories. In this article we cover the basics of connecting to and pushing an image to a private repository to store images.
Before you begin you must have an Oracle Cloud Account as well as Docker Desktop all setup and be able to execute this command in your terminal:
docker -h
We will assume you already have a docker image locally and you want to push it to OCI Container Registry.
List your local docker images with the docker images command:
> docker images
myapp-server latest 9fcb20691b9b 39 hours ago 137MB
Before you can push that image to OCI you need to do two things
Sign into OCI.
Tag the local image with a specifically formatted name.
Sign into OCI
Here's an example of signing into OCI:
> docker login ord.ocir.io
User: yourtenancy/oracleidentitycloudservice/jstortz
Password: <your oci auth token here>
As you can see, you'll need to get an OCI Auth token before you can complete the sign-in step. To do this:
In the top-right corner of the Console, open the Profile 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.
Now you can attempt to sign-in with OCI.
Tag and Push
First, tag the image. You can see what "ID" you need to use by running docker images.
The basic syntax to tag your image looks like this:
docker tag <image-id> <region-domain>/<tenancy>/<container-name>:<version>
Example:
docker tag d2973444a992 ord.ocir.io/redstone/myapp:v1
The "ord.ocir.io" part depends on what OCI Region you want to use.
Use docker images to list your local images and confirm you now see this new tag
Then push with:
docker push <region-domain>/<tenancy>/<container-name>:version
Like this:
docker push ord.ocir.io/redstone/myapp:v1
Voila! Your image is in OCI Registry and ready for you to deploy with various technologies like OCI Container Instances.



