普拉多VX

人生一路,不问来时,不知归期

0%

docker 镜像发布到docker hub

注册账户

首先你得准备一个hub 的帐号, 去 https://hub.docker.com 注册

登录账户并创建仓库

创建仓库

登录到docker hub

1
2
3
4
5
6
luodi@roddydeMacBook-Pro:~$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: roddy1219
Password:
Login Succeeded
luodi@roddydeMacBook-Pro:~$

修改本地镜像tag

打一个tag 名称必须是账户名/仓库:tag

1
2
3
4
5
6
luodi@roddydeMacBook-Pro:~$ docker tag  busybox:latest roddy1219/busybox:latest
luodi@roddydeMacBook-Pro:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 08393e824c32 7 days ago 132MB
busybox latest 018c9d7b792b 2 weeks ago 1.22MB
roddy1219/busybox latest 018c9d7b792b 2 weeks ago 1.22MB

上传

1
2
3
luodi@roddydeMacBook-Pro:~$ docker push roddy1219/busybox:latest
The push refers to repository [docker.io/roddy1219/busybox]
514c3a3e64d4: Pushed

退出docker hub

使用docker logout

1
2
3
luodi@roddydeMacBook-Pro:~$ docker logout
Removing login credentials for https://index.docker.io/v1/
luodi@roddydeMacBook-Pro:~$

注:建议使用阿里云的容器仓库,docker hub太慢