发布镜像

发布镜像到DockerHub

  1. 在DockerHub官网上注册一个账号
  2. 在控制台登录账号
[root@iZbp1htnoa70qlle394f3wZ ~]# docker login -u luoking
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

Login Succeeded

  1. 提交镜像 docker push
1.docker tag 需要提交的镜像ID luoking/kingtomcat:1.0 (作者名/镜像名):版本号
2.docker push luoking/kingtomcat:1.0 (作者名/镜像名):版本号

image
4. 登出

[root@iZbp1htnoa70qlle394f3wZ ~]# docker logout
Removing login credentials for https://index.docker.io/v1/

发布镜像到阿里云

登入阿里云官网
image

$ docker login --username=aliyun653130**** registry.cn-hangzhou.aliyuncs.com
$ docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/luoking/luoking-test:[镜像版本号]
$ docker push registry.cn-hangzhou.aliyuncs.com/luoking/luoking-test:[镜像版本号]

image

posted @ 2022-04-23 16:07  小罗要有出息  阅读(32)  评论(0)    收藏  举报