Uploading image thru Docker in OCI

Upload of image thru GUI OCI console or you can either user cloudshell or thru OCI executable.
To upload you need
- auth key
- tag
- registry name

Auth key generation

You can have maximum of 2 auth keys for the user and make sure you save key when its generated.

oci ce cluster generate-token --cluster-id ocid1.cluster.oc1.iad.....


This should generate less than 20chars and keep it safe.


Docker login

Login into docker using your id. If you are using your corporate SSO, you have to use your OCI federated id and auth token is the password.


docker login us-ashburn-1.ocir.io

Username: <tenancy>/oracleidentitycloudservice/ajit.solomon

Password:

Login Succeeded


Now from your local docker repo you can upload to OCI repository by tagging it.


Docker push

To tag, you have provide region/tenanency/registry_name

docker tag cd14cecfdb3a us-ashburn-1.ocir.io/<tenanency>/jenkins:latest


Prerequisite for pushing an image is to create manually an empty repo/image thru OCI gui. For example, if you want to push the above tagged image jenkins, then go to Container Registry --> Create Registry as jenkins


Now you can push image to OCI registry


docker push us-ashburn-1.ocir.io/<tenanency>/jenkins:latest


If it doesn't find the registry, then OCI will attempt to create it under root compartment.

You can view if it's successful in Developer Services --> Registry(OCIR)