繁体   English   中英

推送Docker私有注册表

[英]Push in docker private registry

我正在关注https://docs.docker.com/registry/deploying/并且我已经在docker.tp.cselt.it上安装了私有Docker注册表

> sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
registry            2                   65b0a3f42eef        7 days ago          165.8 MB
dockerui/dockerui   latest              95c8b9dc91e0        6 weeks ago         6.13 MB

> sudo docker ps -a
CONTAINER ID        IMAGE                      COMMAND                CREATED             STATUS                     PORTS                    NAMES
e142b5f0933e        registry:2                 "/bin/registry /etc/   7 minutes ago       Up 7 minutes               0.0.0.0:5000->5000/tcp   registry
1d5c9e515118        registry:2                 "htpasswd -Bbn testu   7 minutes ago       Exited (0) 7 minutes ago                            romantic_jang
ae7b5d62628f        dockerui/dockerui:latest   "/dockerui"            About an hour ago   Up About an hour           0.0.0.0:9000->9000/tcp   goofy_meitner

在另一台计算机上,我试图在该注册表上推送映像(hello-world):

> docker login docker.tp.cselt.it:5000
Username (testuser):
WARNING: login credentials saved in /home/administrator/.docker/config.json
Login Succeeded

> docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
b901d36b6f2f: Pull complete
0a6ba66e537a: Pull complete
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest

> docker tag hello-world docker.tp.cselt.it:5000/hello-world

> docker images
REPOSITORY                            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
docker.tp.cselt.it:5000/hello-world   latest              0a6ba66e537a        5 months ago        960 B
hello-world                           latest              0a6ba66e537a        5 months ago        960 B

> docker push docker.tp.cselt.it:5000/hello-world
The push refers to a repository [docker.tp.cselt.it:5000/hello-world] (len: 1)
0a6ba66e537a: Image already exists
b901d36b6f2f: Image already exists
latest: digest: sha256:1c7adb1ac65df0bebb40cd4a84533f787148b102684b74cb27a1982967008e4b size: 2744

现在,在第一台机器(docker.tp.cselt.it)上:

> sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
registry            2                   65b0a3f42eef        7 days ago          165.8 MB
dockerui/dockerui   latest              95c8b9dc91e0        6 weeks ago         6.13 MB
> sudo docker exec -it 65b0a3f42eef bash
> ls /var/lib/registry/docker/registry/v2/repositories/
  centos  hello-world  ubuntu

但是当我跑步时:

> curl -u testuser:testpassword -X GET http://docker.tp.cselt.it:5000/v2/_catalog --noproxy docker.tp.cselt.it

我收到 ””

怎么了?

里卡多

curl --noproxy docker.tp.cselt.it -u testuser:testpassword --insecure -X GET  https://docker.tp.cselt.it:5000/v2/_catalog
{"repositories":["hello-world"]}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM