docker pull image to Alibaba Cloud

1) Log in to Alibaba Cloud docker registry:
$ sudo dockerlogin --username=msjtest registry.cn-hangzhou.aliyuncs.com
Note: The username for logging in to the registry is the full name of your Alibaba Cloud account, and the password is the password you set when you opened the namespace.
2) Pull the image from the registry:
$ sudo dockerpull registry.cn-hangzhou.aliyuncs.com/msj/image-test:[image version number]
3) Push the image to the registry:
$ sudo dockerlogin --username=mashujie registry.cn-hangzhou.aliyuncs.com
$ sudo dockertag [ImageId] registry.cn-hangzhou.aliyuncs.com/msj/image-test:[image version number]
$ sudo dockerpush registry.cn-hangzhou.aliyuncs.com/msj/image-test:[image version number]
Among them [ImageId], [Image version number] Please fill in according to your own image information.
8 Terminal execute script code
       #login command
       $ docker login --username=mashujieregistry.cn-hangzhou.aliyuncs.com
       #View host image
       $ docker images
       #Copy the mirror ID and set the tag (or tag repository:tag)
       $ docker tag  96eecaf1019a  registry.cn-hangzhou.aliyuncs.com/msj/image-test: helloimage01
       $ docker tag  image01:01 registry.cn-hangzhou.aliyuncs.com/msj/image-test: helloimage01
        #Upload the image to Alibaba Cloud Mirror Repository
       $ docker pushregistry.cn-hangzhou.aliyuncs.com/msj/image-test: helloimage01

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325682590&siteId=291194637