Imagine a scenario like this. You need to deploy an application on your Kubernetes cluster from local repository. However you plan to make use of an image from publicly available repository. This blog will explain this in regard to Oracle Cloud.
Step 1: Download Image from public
In this example, I’m using ‘nginx’ application. You’ll need to download this image to your local environment first, as shown in Figure1.

Then, we need to make sure the image is received properly with the ‘docker images’ command.

Step 2: Create Repository
We need to create our internal repository next. In Oracle Cloud Infrastructure, its called ‘Oracle Cloud Infrastructure Registry’ or OCIR which you can find under ‘Developer Services’.

Figure 4 shows the repository once it’s successfully created.

Step 3: Prepare Auth Token
Then, we need to authenticate the tenant user account to OCIR. For this, you need to create an ‘Auth token’ as below.

Once the token is generated, you will need to copy and store it as it will not show the value again.

Step 4: Push Image to OCIR
Now, we can prepare the credentials required to log in to OCIR as below.
username: <namespace>/<email or username>
password: auth token generated above
Figure 7 below shows the process of login to the OCIR. Here, ‘sin’ represent the OCI region (In this case, Singapore).
“docker login <region code>.ocir.io”

Next, we need to ‘tag’ the image with the preferred identification as in Figure 8.

Finally we can push the image to the repository with ‘docker push’ command.

We can visually verify the image by login into the console. There, we can find the full path to the image as well.

Step 5: Deploy on OKE by Pulling Image from OCIR
Once the image push is successful and full path is copied we can use it for a deployments. In the below example, nginx application to be deployed on OKE by pullling the image from OCIR.

DEPLOYMENTS ON OCI OKE FROM OCIR