docker / docker/cli

login subcommand does not respect URL path, unlike registry which has url prefix setting.

Open
#3,255 4 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/authentication area/distribution
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

A docker registry using the distribution project can be configured with a url prefix instead of "/". this then makes it impossible to log in because the

Here's someone facing the same issue.

Steps to reproduce the issue:

  1. start private registry with this config (http.prefix) set to /test, this can be done with a simple docker run command, as these variables are all also read from env vars.
  2. run docker login localhost:5001/test and
  3. notice that requests are coming on on localhost:5001/v2 and not localhost:5001/test/v2

Describe the results you received:

as described in #190, the url is simply cut off and then you can never reach the endpoint you need to continue.

Describe the results you expected:
I expected this software to behave like this one, which, for example, will request 2 different /.well-known urls before giving up. the one at the root, ./well-known, and then /the/path/given/as/argument/.well-known.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Docker version 19.03.12, build 48a66213fe

Output of docker info:

expand
Client:
 Debug Mode: false

Server:
 Containers: 9
  Running: 1
  Paused: 0
  Stopped: 8
 Images: 29
 Server Version: 19.03.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-80-generic
 Operating System: Ubuntu 20.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.55GiB
 Name: tb1-Latitude-3440
 ID: VO74:Z6HH:U4JV:2B6T:YAWD:DVZA:Z3RX:SL37:WUA2:G7IT:O3BA:5BIW
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):

physical. (registry is running in the cloud, its proxied behind nginx, which is where i am seeing the urls it is requesting.

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

Start by reproducing the issue with a distribution registry configured with http.prefix set to /test, then run docker login localhost:5001/test and inspect the login subcommand's request construction. Done means requests use the supplied path, reaching localhost:5001/test/v2 rather than the root /v2 endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
authentication, cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.