Pushing Docker Images to DockerHub and Alibaba Cloud Container Registry

Pushing Images to Alibaba Cloud Container Registry

Authentication

Authenticate with your Alibaba Cloud registry endpoint:

sudo docker login --username=your_account_name registry.cn-hangzhou.aliyuncs.com

The username should be your full Alibaba Cloud account ID, and the password is the one you configured when creating the namespace.

You can modify your docker login credentials from the Container Registry management console.

Pulling Images

To fetch an image from the registry:

sudo docker pull registry.cn-hangzhou.aliyuncs.com/your_namespace/project_name:[tag]

Pushing Images

Follow these steps to upload a local image:

# Authenticate first
sudo docker login --username=your_account_name registry.cn-hangzhou.aliyuncs.com

# Tag the local image with the remote registry path
sudo docker tag local_image_id registry.cn-hangzhou.aliyuncs.com/your_namespace/project_name:[tag]

# Push to the registry
sudo docker push registry.cn-hangzhou.aliyuncs.com/your_namespace/project_name:[tag]

Replace local_image_id and [tag] with your actual image details.

Network Considerations

When pushing from an ECS instance within the same region, use the internal endpoint to avoid public bandwidth charges and improvee transfer speeds significantly.

For classic network instances, use:

registry-internal.cn-hangzhou.aliyuncs.com

For VPC network instances, use:

registry-vpc.cn-hangzhou.aliyuncs.com

Example Workflow

Tag an existing image for internal registry delivery:

sudo docker images

REPOSITORY                                  TAG        IMAGE ID       CREATED        SIZE
registry.aliyuncs.com/acs/agent            0.7-dfb6816 37bb9c63c8b2   7 days ago     37.89 MB

sudo docker tag 37bb9c63c8b2 registry-vpc.cn-hangzhou.aliyuncs.com/acs/agent:0.7-dfb6816

sudo docker push registry-vpc.cn-hangzhou.aliyuncs.com/acs/agent

Pushing Images to DockerHub

Tag your local image to match your DockerHub repository name:

docker tag local_image_id username/repository:tag

For example:

docker tag 5dbb7f7b2902 mydockerid/tomcat:latest

Then push the image:

docker push username/repository:tag

Example:

docker push mydockerid/tomcat:latest

Ensure you are logged into DockerHub before pushing:

docker login

Tags: docker dockerhub aliyun container-registry devops

Posted on Thu, 16 Jul 2026 16:39:48 +0000 by lush_pierre