docker / docker/cli

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

Open
#5,042 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/0-triage
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

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;
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Start with the linked forum report and trace the Docker CLI registry push path, then reproduce a push against a registry served under /registry; done means the push preserves the URL prefix without the nginx rewrite workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, nginx
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.