需要按照如下步骤处理:
我一直没有第三步,一直没有成功,直到尝试了一次docker tag ,上传docker hub就没有出现问题了。
step1——找到本地镜像的ID:docker images
step2——登陆Hub:docker login --username=username --password=password --email=email
step3——tag:docker tag <imageID> <namespace>/<image name>:<version tag eg latest>
step4——push镜像:docker push <namespace>/<image name>
1
2
3
4
5
6
7
8
9
10
11
12
|
[root@salt-master centos6]
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos6-
ssh
latest f6bb69ea7020 About an hour ago 556.4 MB
docker.io
/jdeathe/centos-ssh
latest f6aa254214ab 32 hours ago 214.7 MB
docker.io
/centos
centos6 8315978ceaaa 4 weeks ago 194.6 MB
[root@salt-master centos6]
# docker tag f6bb69ea7020 516249940/centos6-ssh:v1
[root@salt-master centos6]
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
516249940
/centos6-ssh
v1 f6bb69ea7020 About an hour ago 556.4 MB
centos6-
ssh
latest f6bb69ea7020 About an hour ago 556.4 MB
docker.io
/jdeathe/centos-ssh
latest f6aa254214ab 32 hours ago 214.7 MB
docker.io
/centos
centos6 8315978ceaaa 4 weeks ago 194.6 MB
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[root@salt-master centos6]
# docker push 516249940/centos6-ssh:v1
The push refers to a repository [docker.io
/516249940/centos6-ssh
]
e1e3a72d67ca: Layer already exists
05da2767947a: Layer already exists
ba149593d1ad: Layer already exists
eed64a3d3cac: Layer already exists
70a84a101c16: Layer already exists
52dcf50b12eb: Pushed
08204235bfac: Layer already exists
6cbd0415f265: Pushed
d73c31c5daa6: Layer already exists
v1: digest: sha256:79b18121746c65f6c55f4cf424bc11f6cb3004e3e071f8083484945ff278d1b9 size: 2174
[root@salt-master centos6]
#
|
登录我的docker hub看看查看仓库
本文转自 yanconggod 51CTO博客,原文链接:http://blog.51cto.com/yanconggod/1880051