Oftencase the Docker hub is where general open-source developers store their Docker images. But occasionally when you want to use the Oracle Cloud Infrastructure, you'd want to upload those images to your cloud tenancy's private Container Registry to simplify your development to production workflow. Here's how you do it.
Note: To use this service, you must upgrade to a paid account.
1. Find your tenancy namespace in Oracle Cloud > Profile Picture > Tenancy, e.g. iddriaq7lag549
2. Create an Auth Token in your Oracle Cloud > Profile > My Profile > User Settings > Auth Tokens. This will be your Docker login password.
3. Login to the Container Registry on Docker using:
docker login iad.ocir.io
If you are not using the Ashburn (IAD) region, please refer to this list for your docker login URL.
4. The Terminal will prompt you for your username and password. Your username and password will look like this:
idrriaq7lag5is the tenancy namespace you found in Step 1
firstname.lastname@example.org your Oracle Cloud login email
- the password is the Auth Token retrieved in Step 2
Of course, you can also do a one-liner:
docker login -u 'email@example.com' -p 'DBY75ZmVsc_v3!Qg6duC' https://iad.ocir.io
5. Now you can build, push, and pull your Docker images as usual using:
docker build -t iad.ocir.io/idrriaq7lag5/myImage:latest . docker push iad.ocir.io/idrriaq7lag5/myImage:latest docker pull iad.ocir.io/idrriaq7lag5/myImage:latest
You will find the pushed image in the Container Registry (
root compartment). You can move the image to any other compartment afterwards.
6. If you want to logout, simply:
docker logout iad.ocir.io
And that's a short guide to using Docker for Oracle Cloud's Container Registry.
Safe harbor statement
The information provided on this channel/article/story is solely intended for informational purposes and cannot be used as a part of any contractual agreement. The content does not guarantee the delivery of any material, code, or functionality, and should not be the sole basis for making purchasing decisions. The postings on this site are my own and do not necessarily reflect the views or work of Oracle or Mythics, LLC.
This work is licensed under a Creative Commons Attribution 4.0 International License.