[英]Error docker registry behind nginx, push and pull
我正在嘗試創建一個 docker 注冊表並且發生了一些問題,我無法執行推和拉等操作,它遵循我的環境設置:
# docker container run -d -p 5000:5000 --name registry --restart=always registry:2
放在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;
}
}
但是我執行的任何操作,例如推或拉,都會返回錯誤 404
碼頭推:
# 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 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"
我還在我的 docker 服務器和本地配置了:
{
"insecure-registries" : ["registry-srv-web.myregistry.com"]
}
我也閱讀了幾個類似的問題,但沒有一個解決。 為什么我不使用ssl 的一個細節,以及我在一個孤立的網絡上並且我不打算發布我的注冊表的事實。
有關如何解決它的任何提示?
我認為 docker 無法訪問 registry-srv-web.myregistry.com 您應該 telnet registry host 來確認這一點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.