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

docker push doesn't work for registry with url prefix. #5042

Open
cupen opened this issue Apr 29, 2024 · 0 comments
Open

docker push doesn't work for registry with url prefix. #5042

cupen opened this issue Apr 29, 2024 · 0 comments

Comments

@cupen
Copy link

cupen commented Apr 29, 2024

From
https://forums.docker.com/t/docker-push-does-not-support-url-prefix/137709

Here is my nginx config for workaround.

location /registry {
    proxy_pass http://127.0.0.1:5000;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout 900;
}

# NOTE: Workaround for docker cli push without prefix
# @https://forums.docker.com/t/docker-push-does-not-support-url-prefix/137709
# Nginx config:
#   client_body_buffer_size 128k;
#   client_max_body_size 50m;
location ~ ^/v2/(.*)$ {
    proxy_pass http://127.0.0.1:5000/registry/v2/$1;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout 900;
}
@cupen cupen changed the title docker push doestn't work for registry with url prefix. docker push doesn't work for registry with url prefix. Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant