docker / cli

The Docker CLI
Apache License 2.0
4.74k stars 1.88k forks source link

v26.1.4 -> 27.0.1: "docker login https://myregistry:444/" loses port #5194

Closed linsomniac closed 1 week ago

linsomniac commented 1 week ago

Description

Also reported to Jenkins Docker Plugin here: https://github.com/jenkinsci/docker-plugin/issues/1082

The Jenkins Docker plugin insists on prefixing the registry with "https://" (see above bug for details). After an upgrade to 27.0.1, this is now failing, reporting a 404 error reaching "https://myregistry.example.com/v2/" (note the missing :444).

At v26.1.4, both of these commands produce the same output:

If I enter an invalid user/password, both of those report "401 Unauthorized".

At 27.0.1, the second command produces the 401, but the first command reports a 404, with the URL "https://myregistry.example.com/v2/"

I have checked the 27.0.1 release notes and have seen nothing about a change related to the registry URL or docker login.

Reproduce

Detailed above.

Expected behavior

Detailed above.

docker version

Client: Docker Engine - Community
 Version:           27.0.1
 API version:       1.46
 Go version:        go1.21.11
 Git commit:        7fafd33
 Built:             Mon Jun 24 14:57:52 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.0.1
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       ff1e2c0
  Built:            Mon Jun 24 14:57:52 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.18
  GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc:
  Version:          1.7.18
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    27.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.28.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 27.0.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: journald
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-112-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 2.829GiB
 Name: cp1.dev.realgo.com
 ID: a0727121-0f96-415e-a3af-5143b8aecfd1
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

No response

CarstonSchilds commented 1 week ago

I have a PR with a fix for this: https://github.com/docker/cli/pull/5195