Docker 为什么不能将映像推送到我的私有注册表?

Docker 为什么不能将映像推送到我的私有注册表?,docker,docker-registry,Docker,Docker Registry,服务: docker service create --name registry --secret domain.crt --secret domain.key --constraint 'node.labels.registry==true' --mount type=volume,src=registry-data,dst=/var/lib/registry --mount type=bind,src=/etc/docker/auth,dst=/auth -e REGISTRY_HTTP_

服务:

docker service create --name registry --secret domain.crt --secret domain.key --constraint 'node.labels.registry==true' --mount type=volume,src=registry-data,dst=/var/lib/registry --mount type=bind,src=/etc/docker/auth,dst=/auth -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/domain.crt -e REGISTRY_HTTP_TLS_KEY=/run/secrets/domain.key -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd --publish published=443,target=443 --replicas 1 registry:2
docker login lcy_docker1.example
docker tag hello-world lcy_docker1.example/hello-world
docker push lcy_docker1.example/hello-world

# The push refers to repository [lcy_docker1.example/hello-world]
# Get https:///v2/: http: no Host in request URL
登录:

docker service create --name registry --secret domain.crt --secret domain.key --constraint 'node.labels.registry==true' --mount type=volume,src=registry-data,dst=/var/lib/registry --mount type=bind,src=/etc/docker/auth,dst=/auth -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/domain.crt -e REGISTRY_HTTP_TLS_KEY=/run/secrets/domain.key -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd --publish published=443,target=443 --replicas 1 registry:2
docker login lcy_docker1.example
docker tag hello-world lcy_docker1.example/hello-world
docker push lcy_docker1.example/hello-world

# The push refers to repository [lcy_docker1.example/hello-world]
# Get https:///v2/: http: no Host in request URL
用户名:admin

密码:

登录成功

推送:

docker service create --name registry --secret domain.crt --secret domain.key --constraint 'node.labels.registry==true' --mount type=volume,src=registry-data,dst=/var/lib/registry --mount type=bind,src=/etc/docker/auth,dst=/auth -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/domain.crt -e REGISTRY_HTTP_TLS_KEY=/run/secrets/domain.key -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd --publish published=443,target=443 --replicas 1 registry:2
docker login lcy_docker1.example
docker tag hello-world lcy_docker1.example/hello-world
docker push lcy_docker1.example/hello-world

# The push refers to repository [lcy_docker1.example/hello-world]
# Get https:///v2/: http: no Host in request URL

为什么不能推送到我的私有注册表?

问题是您没有将lcy_docker1的主机条目放入。例如,从哪里推送到映像。还要确保在标记图像时也指定注册表端口。 例如:docker run-t-i ubuntu/bin/bash docker标签ubuntu 52.203.56.158:5000/ubuntu:v3 docker push 52.203.56.158:5000/ubuntu:v3

尝试从域中删除下划线字符串。 lcy_docker1.example->lcydocker1.example


您使用的是什么版本的Docker?Docker ce。18帮帮我,为什么端口不是HTTPS443?我将端口443定义为服务@萨维奥Mathew@YOUNGWANT这只是一个例子。如果您输入一个主机条目,您报告的问题将得到解决。