[root@hmm ~]# vi /etc/docker/daemon.json
[root@hmm ~]# systemctl daemon-reload
[root@hmm ~]# systemctl restart docker
[root@hmm ~]# cat /etc/docker/daemon.json
{
"registry-mirrors":["https://registry.docker-cn.com"]
}
[root@hmm ~]#
[root@hmm ~]# docker login --username=aliyun0475555124 registry.cn-hangzhou.aliyuncs.com
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
[root@hmm ~]# docker build -t registry.cn-hangzhou.aliyuncs.com/hanmiao_03/hmmmm:24.03.26 .
[+] Building 0.1s (5/5) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 79B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 28B 0.0s
=> CACHED [1/1] COPY hello / 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:e8c9e00260a8e1518736ea7a6b7d596a61cf3bd7d4e04bc19be0cf2f417cf28a 0.0s
=> => naming to registry.cn-hangzhou.aliyuncs.com/hanmiao_03/hmmmm:24.03.26 0.0s
[root@hmm ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos-with-nginx latest fe0f7fc1d27c 13 days ago 248MB
imglayers-test latest 3d2d641327e8 13 days ago 196MB
my-hello latest e8c9e00260a8 2 weeks ago 861kB
registry.cn-hangzhou.aliyuncs.com/hanmiao_03/hmmmm 24.03.26 e8c9e00260a8 2 weeks ago 861kB
ubuntu latest ca2b0f26964c 3 weeks ago 77.9MB
httpd latest ac45b24b92cc 2 months ago 167MB
ubuntu 18.04 f9a80a55f492 10 months ago 63.2MB
hm/ubuntu hhh f9a80a55f492 10 months ago 63.2MB
hello-world latest d2c94e258dcb 10 months ago 13.3kB
centos latest 5d0da3dc9764 2 years ago 231MB
ubuntu 14.04 13b66b487594 3 years ago 197MB
[root@hmm ~]# docker push registry.cn-hangzhou.aliyuncs.com/hanmiao_03/hmmmm:24.03.26
The push refers to repository [registry.cn-hangzhou.aliyuncs.com/hanmiao_03/hmmmm]
489199a05e67: Pushed
24.03.26: digest: sha256:b44cd7cf49ecca2044d5ff0c7f1ccfdc49e68d1edb8ee098eef261b7ee452bbe size: 526
标签:ago,仓库,0.0,hmm,阿里,com,镜像,docker,root
From: https://www.cnblogs.com/humlogs/p/18097183