You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found in Gitlab CI that if registry URL doesn't contain host but has scheme and path docker will try to login to registry-1.docker.io. This is happening when hostname is in env variable and this variable is empty.
I have this problem with Docker on Ubuntu 20.04 but I think OS isn't relevant to this issue.
Tested versions:
Docker version 24.0.5, build 24.0.5-0ubuntu1~20.04.1
Docker version 26.1.1, build 4cf5afa
Also tested with podman as daemon and run docker:latest image with hash sha256:8bd6302a909f6f2ed9a17058cce2d83442bddb9e65c974352c2ba485a1e6d7ba and with podman there is no problem.
Reproduce
Docker daemon + docker image:
sudo docker run -it --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock docker:latest ash
Error response from daemon: login attempt to failed with status: authenticating creds for "": pinging container registry : Get "https:///v2/": http: no Host in request URL
Expected behavior
Docker has to check URL for empty hostname and show error about invalid address instead of fallback to registry-1.docker.io
Description
Found in Gitlab CI that if registry URL doesn't contain host but has scheme and path docker will try to login to registry-1.docker.io. This is happening when hostname is in env variable and this variable is empty.
I have this problem with Docker on Ubuntu 20.04 but I think OS isn't relevant to this issue.
Tested versions:
Also tested with podman as daemon and run
docker:latest
image with hashsha256:8bd6302a909f6f2ed9a17058cce2d83442bddb9e65c974352c2ba485a1e6d7ba
and with podman there is no problem.Reproduce
Docker daemon + docker image:
sudo docker run -it --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock docker:latest ash
export REGISTRY_LOGIN="test" REGISTRY_PASS="test"
docker login "https:///repository/docker/" -u "$REGISTRY_LOGIN" -p "$REGISTRY_PASS"
Podman daemon + docker image:
systemctl start --user podman.socket
Run podman socket as user (rootless)podman run -it --rm --privileged -v $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock:Z docker:latest ash
export REGISTRY_LOGIN="test" REGISTRY_PASS="test"
docker login "https:///repository/docker/" -u "$REGISTRY_LOGIN" -p "$REGISTRY_PASS"
Expected behavior
Docker has to check URL for empty hostname and show error about invalid address instead of fallback to
registry-1.docker.io
docker version
Client: Docker Engine - Community Version: 26.1.1 API version: 1.45 Go version: go1.21.9 Git commit: 4cf5afa Built: Tue Apr 30 11:48:20 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 26.1.1 API version: 1.45 (minimum version 1.24) Go version: go1.21.9 Git commit: ac2de55 Built: Tue Apr 30 11:48:20 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.31 GitCommit: e377cd56a71523140ca6ae87e30244719194a521 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: