- 登录账号
# 1. 登录DockerHub账号 docker login -u genghenggao # 2. 输入密码
2.push到DockerHub
# 提交, root@docker:/home/tomcat# docker push henggao_tomcat Using default tag: latest The push refers to repository [docker.io/library/henggao_tomcat] 4c8f6523e5bc: Preparing aa3eb8513d23: Preparing 42fb9b5c0574: Preparing 2dd8e560e2cb: Preparing e3cedffefb89: Preparing 74ddd0ec08fa: Waiting denied: requested access to the resource is denied # 解决:给镜像打上标签tag,注意:用户名/镜像名:1.0 root@docker:/home/tomcat# docker tag df5c0f668c0d genghenggao/tomcat:1.0 #push到dockerhub root@docker:/home/tomcat# docker push genghenggao/tomcat:1.0
虚拟机发布的有些慢,可以找个小一点镜像进行测试。🤣
我这里提交了一个hello-world
root@docker:/home/tomcat# docker tag feb5d9fea6a5 genghenggao/hello-world:1.0 root@docker:/home/tomcat# docker images REPOSITORY TAG IMAGE ID CREATED SIZE genghenggao/tomcat 1.0 df5c0f668c0d 56 minutes ago 738MB henggao/tomcat 1.0 df5c0f668c0d 56 minutes ago 738MB henggao_tomcat latest df5c0f668c0d 56 minutes ago 738MB entrypoint-test latest 50eaee991418 2 hours ago 231MB cmdtest latest 35481d75c5de 3 hours ago 231MB mycentos 1.0 06b45461b474 3 hours ago 319MB henggao/centos 1.0 d3c700b4cc56 13 hours ago 231MB tomcat01 1.0 894d74f50dc3 25 hours ago 684MB tomcat 9.0 4e2e87a81bc1 38 hours ago 680MB tomcat latest 5db6fed793e9 41 hours ago 680MB nginx latest 04661cdce581 7 days ago 141MB portainer/portainer-ce latest a1c22f3d250f 3 weeks ago 252MB mysql latest ecac195d15af 4 weeks ago 516MB genghenggao/hello-world 1.0 feb5d9fea6a5 7 weeks ago 13.3kB hello-world latest feb5d9fea6a5 7 weeks ago 13.3kB centos latest 5d0da3dc9764 2 months ago 231MB elasticsearch 7.14.2 2abd5342ace0 2 months ago 1.04GB root@docker:/home/tomcat# docker push genghenggao/hello-world:1.0
- DockerHub查看