简体   繁体   English

docker推送到私人注册表挂起

[英]docker push to private registry hangs

I have setup, both the repl supplied docker-registry and the official docker registry image from docker hub both have the same issue I am seeing. 我有设置,repl提供的docker-registry和docker hub的官方docker注册表图像都有我遇到的相同问题。

I have an image which I have tagged with the docker registry hostname and port etc, and try and push it to the registry. 我有一个图像,我用docker注册表主机名和端口等标记,并尝试将其推送到注册表。

On hitting enter, it appears to run ok, checking for image layers the registry already has. 在按Enter键时,它似乎运行正常,检查注册表已有的图像层。 Once it starts to push an image layer it doesn't have, it hangs; 一旦它开始推动它没有的图像层,它就会挂起; and stays there, forever until I ctrl+c out of it 永远呆在那里,直到我ctrl + c出来

Example: 例:

[root@docker1 ~]# docker push docker1:5000/centos:7
The push refers to a repository [docker1:5000/centos] (len: 1)
Sending image list
Pushing repository docker1:5000/centos (1 tags)
Image 511136ea3c5a already pushed, skipping
Image 5b12ef8fd570 already pushed, skipping
5c5681003a50: Pushing [>                                                  ] 1.584 MB/220.5 MB 2m9s

In the docker logs for the docker-registry container thats running, it has: 在运行的docker-registry容器的docker日志中,它具有:

10.10.10.2 - - [06/Apr/2015:17:11:01 +0000] "PUT /v1/images/f6808a3e4d9e80a655ec625e38b869ed8a614611e4d0073aeff23be841c9fcff/json HTTP/1.1" 200 4 "-" "docker/1.1.1 go/go1.2.1 git-commit/bd609d2 kernel/3.15.3-tinycore64 os/linux arch/amd64"
06/Apr/2015:17:11:02 +0000 DEBUG: args = {'image_id': u'f6808a3e4d9e80a655ec625e38b869ed8a614611e4d0073aeff23be841c9fcff'}

and no errors as far as I can see. 就我所见,没有错误。

I have tried pushing from a remote server on and locally to itself, and still the same. 我试过从远程服务器上本地推送到自己,并且仍然是相同的。 iptables is off, as is selinux. iptables是关闭的,selinux也是如此。

Not really sure what else to try. 不确定还有什么可以尝试的。

Regards, K 问候,K

I did find out in my tests, that if I pushed to localhost it would work fine, but going via the main interface it would fail. 我确实在我的测试中发现,如果我推送到localhost它会工作正常,但通过主界面它会失败。 Again no IPTables etc running. 再次没有IPTables等运行。

I have got around the problem, by pulling the nginx image, and running that a proxy_pass on that to the registry. 我已经解决了这个问题,通过拉动nginx映像,并在其上运行proxy_pass到注册表。

I did have to set 我确实要设置

client_max_body_size 0;

as was getting 411 Length Required' errors, initially. 最初是获得411长度所需的'错误'。

This is a happy workaround, as I would eventually like to put htaccess in front of it anyway, so C'est la vie. 这是一个快乐的解决方法,因为我最终还是希望将htaccess放在它面前,所以C'est la vie。

K ķ

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

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