Skip to content

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

@alexanderankin

Description

@alexanderankin

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions