Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make proxy to work #222

Closed
pztrn opened this issue Dec 20, 2021 · 3 comments
Closed

Can't make proxy to work #222

pztrn opened this issue Dec 20, 2021 · 3 comments

Comments

@pztrn
Copy link

pztrn commented Dec 20, 2021

I'm trying to get 2.1.0 to work with registry using proxy method but unable to push images.

My compose file:

version: "2.4"

services:
  registry:
    image: "registry:2.7.1"
    restart: always
    volumes:
      - "/root/registry/data:/var/lib/registry"
    environment:
      REGISTRY_STORAGE_DELETE_ENABLED: "true"

  webui:
    image: "joxit/docker-registry-ui:2.1.0"
    restart: always
    ports:
      - "192.168.1.2:28880:80"
    environment:
      REGISTRY_TITLE: "pztrn's Private Registry"
      NGINX_PROXY_PASS_URL: http://registry:5000
      SINGLE_REGISTRY: "true"
      DELETE_IMAGES: "true"
    depends_on:
      - registry

I've modified docker's configuration to use my registry as insecure and used registry.pztrn.internal domain which routed via Caddy. And here's what happen:

docker push registry.pztrn.internal/theimage:0.0.16
The push refers to repository [registry.pztrn.internal/theimage]
65bba11443ba: Retrying in 4 seconds
addbaed7634c: Layer already exists
aa9d9b569731: Retrying in 4 seconds
07d3c46c9599: Retrying in 4 seconds

Registry is definetely accessible via /v2/_catalog path, so no problems here, but I suppose there might be an issue with nginx configuration because I have this in logs:

webui_1     | 2021/12/20 09:31:50 [warn] 135#135: *27 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 192.168.1.2, server: localhost, request: "PATCH /v2/theimage/blobs/uploads/af68d7a4-84f7-43cd-9c6d-af5ea790b928?_state=Sh9ut4fdxMeLYqzv9wBnhskJ1leXex3jbpzkPdd6x6F7Ik5hbWUiOiJyZW1pbmRtZWJvdCIsIlVVSUQiOiJhZjY4ZDdhNC04NGY3LTQzY2QtOWM2ZC1hZjVlYTc5MGI5MjgiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjEtMTItMjBUMDk6MzE6NDkuODgwNTU4NTcxWiJ9 HTTP/1.1", host: "registry.pztrn.internal"

Maybe this prevents me from using registry in proxy mode? And ideas?

@pztrn
Copy link
Author

pztrn commented Dec 20, 2021

Just tried to push directly to docker-registry-ui - same result:

The push refers to repository [192.168.1.2:28880/theimage]
65bba11443ba: Retrying in 3 seconds
addbaed7634c: Layer already exists
aa9d9b569731: Retrying in 3 seconds
07d3c46c9599: Retrying in 3 seconds

@Joxit
Copy link
Owner

Joxit commented Dec 25, 2021

Hello, thank you for using my project 😄

Is this related to #191 #88 or #113 ?

IIRC:

  • These lines prevent nginx buffering when push
    client_max_body_size 0;
    # required to avoid HTTP 411: see Issue #1486 (https://github.com/moby/moby/issues/1486)
    chunked_transfer_encoding on;
    # required for strict SNI checking: see Issue #70 (https://github.com/Joxit/docker-registry-ui/issues/70)
    proxy_ssl_server_name on;
    proxy_buffering off;
    proxy_ignore_headers "X-Accel-Buffering";
  • This one prevent a weird docker registry behavior on image push. You must forward the original host used by the client
    ENV NGINX_PROXY_HEADER_Host '$http_host'

@Joxit
Copy link
Owner

Joxit commented Oct 21, 2022

Hi, I close this issue due to inactivity.

@Joxit Joxit closed this as completed Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants