简体   繁体   English

nginx 后面的 docker 注册表错误,推拉

[英]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.

相关问题 Docker Registry Pull错误 - Docker Registry Pull error docker 注册表推送错误 - docker registry push error 在AWS上的Nginx后面部署https docker注册表 - Deploy an https docker registry behind nginx on AWS 限制推和拉到Docker受信任的注册表DTR - Restrict push and pull to docker trusted registry DTR docker pull / push无法使用不安全的注册表 - docker pull/push not working with insecure registry 无法推/拉到远程Docker注册表 - Cannot push/pull to remote docker registry docker(代理后面)从azure容器注册表工作拉,但是从registry-1.docker.io,它提供由未知权限错误签名的证书 - docker (behind a proxy) pull from azure container registry works but from registry-1.docker.io, it gives certificate signed by unknown authority error 对Nginx背后的Docker私有注册表的请求由HTTPS虚拟主机处理 - Requests to docker private registry behind nginx are handled by an HTTPS vhost docker 推送到 nexus 注册表(代理后)以 EOF 结尾 - docker push to nexus registry (behind proxy) ends with EOF 如何从公共注册表中提取Docker映像并将其推送到私有openshift? - How to pull docker images from public registry and push it to private openshift?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM