with our Harbor based Container Management Solution
Ready to push the image to a registry? In this post, we will discuss how to get started with Container Registry.
Upon sign in successfully, you should be able to see the page below.
Navigate the UIs, and the repositiries
should be empty. Let’s build and push some containers
Make sure you have docker installed
Click on User Profile to get the password for container-registry.
Copy the CLI secret, and user it to with docker login
in below.
Login with docker login
username is case-sensitive
docker login -u USER_NAME
Get the minimum hello world app in Go from this cncf-demo repo
username here should be all lowercase, despite you have upper case for actual username
git clone https://github.com/WLun001/cncf-demo
cd cncf-demo/examples/hello-world
# build image with multiple tags
docker build -t hello-world:1.0 -t /USER_NAME/hello-world:1.0 .
To view built images
Both images have the same Image ID, showing two images because were tagged differently with
-t
flag
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
/USER_NAME/hello-world 1.0 cf417f3ab6cf 18 seconds ago 12MB
hello-world 1.0 cf417f3ab6cf 18 seconds ago 12MB
To push the image
$ docker push /USER_NAME/hello-world:1.0
The push refers to repository [/USER_NAME/hello-world]
3d8d5e255593: Pushed
543a4c33c12f: Pushed
50644c29ef5a: Layer already exists
1.0: digest: sha256:9463678f592aa6e5ef72dcf735ce60a5aad53359e68dd5e48b14b6b6d1b2c753 size: 947
Go back to the console UI, should see the image has been pushed
The image size on local is 12 MB, but the UI showing 5.90 MB. This is because the image is compressed after pushed, or rather only 5.90 MB is required to download this image.
To pull image, click on the Pull command
, or use command below
docker pull /wlun001/hello-world@1.0
The pull count should be updated
To view storage quota or consumption, click on the Summary
tab
Contact our support and get unstuck
Published — April 9, 2021