⭕ DockerHub仓库
-----------------------------# 登录-----------------------------$ docker login -u darling57Password: Login Succeeded-----------------------------# 上传到仓库-----------------------------$ docker tag 422abe06e570 darling57/mytomcat #需要使用[tag]命令将镜像名改为[用户名/镜像名]格式$ docker push darling57/mytomcatThe push refers to repository [docker.io/darling57/mytomcat]44833859dc5b: Pushed b1f6fbb2bd99: Pushed ea00b66292ac: Pushed 3d66f54c4753: Pushed a3a6ee3afc4d: Pushed latest: digest: sha256:9b3a641af4c9e963aa101ecd173a6d1249796fb26dd12213a0efdd0b3d40a3b6 size: 1372
⭕ 上传到华为云镜像容器仓库
--------------------------------------# 登录--------------------------------------# 从华为云获得临时登录指令$ docker login -u cn-southwest-2@A8SGVP64K6VJK7TSIK5A -p dd020abdb244ce724a144c447b11170df0e89005f100f7c0889a49054057cbd4 swr.cn-southwest-2.myhuaweicloud.com--------------------------------------# 上传到仓库--------------------------------------[root@redistest test]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEmytomcat 1.0 422abe06e570 2 hours ago 503MB# sudo docker tag [{镜像名称}:{版本名称}] swr.cn-southwest-2.myhuaweicloud.com/{组织名称}/{镜像名称}:{版本名称}$ sudo docker tag mytomcat:1.0 swr.cn-southwest-2.myhuaweicloud.com/darling/mytomcat:1.0# sudo docker push swr.cn-southwest-2.myhuaweicloud.com/{组织名称}/{镜像名称}:{版本名称}$ docker push swr.cn-southwest-2.myhuaweicloud.com/darling/mytomcat
