[英]Error docker registry behind nginx, push and pull
I am trying to create a docker registry and some problems are happening, I can not perform operations like push and pull, it follows the settings of my environment:我正在尝试创建一个 docker 注册表并且发生了一些问题,我无法执行推和拉等操作,它遵循我的环境设置:
# docker container run -d -p 5000:5000 --name registry --restart=always registry:2
put behind nginx proxy, follow the settings myregistry.conf:放在nginx代理后面,按照myregistry.conf的设置:
upstream docker_registry {
server 127.0.0.1:5000;
}
map $upstream_http_docker_distribution_api_version $docker_distribution_api_version {
'' 'registry/2.0';
}
server {
listen 80;
server_name registry-srv-web.myregistry.com;
ssl off;
proxy_send_timeout 120;
proxy_read_timeout 300;
proxy_buffering off;
tcp_nodelay on;
server_tokens off;
client_max_body_size 1G;
chunked_transfer_encoding on;
location / {
if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
return 404;
}
add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Authorization "";
proxy_set_header Host $http_host;
proxy_read_timeout 90;
proxy_pass http://docker_registry;
}
}
but any operation I perform, such as push or pull, returns error 404但是我执行的任何操作,例如推或拉,都会返回错误 404
docker push:码头推:
# docker push registry-srv-web.myregistry.com.br/ubuntu
The push refers to repository [registry-srv-web.myregistry.com/ubuntu]
059ad60bcacf: Preparing
8db5f072feec: Preparing
67885e448177: Preparing
ec75999a0cb1: Preparing
65bdd50ee76a: Preparing
error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"
docker pull:码头拉:
# docker pull registry-srv-web.myregistry.com/ubuntu
Using default tag: latest
Error response from daemon: error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"
I also configured in my docker server and local:我还在我的 docker 服务器和本地配置了:
{
"insecure-registries" : ["registry-srv-web.myregistry.com"]
}
I also read several similar questions posted, but none of them solved.我也阅读了几个类似的问题,但没有一个解决。 One detail why I'm not using ssl , and the fact that I'm on an insular network and I do not intend to publish my registry.为什么我不使用ssl 的一个细节,以及我在一个孤立的网络上并且我不打算发布我的注册表的事实。
Any hint about how to solve it?有关如何解决它的任何提示?
我认为 docker 无法访问 registry-srv-web.myregistry.com 您应该 telnet registry host 来确认这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.