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
When the config file is a relative symlink, docker cli can't handle it properly. Every config file writing operation, like docker login or docker context use, will take no effect on the real config file, but instead it creates a new file that relative to the current working directory.
Reproduce
In a fresh new docker environment:
$ mkdir ~/.docker
$ echo '{}' > ~/.docker/config-company.json
$ ln -s config-company.json ~/.docker/config.json # this create a relative symlink
$ ls -l ~/.docker/config.json
lrwxrwxrwx 1 user group 22 Jul 23 21:37 /home/user/.docker/haha.json -> config-company.json
$ cat ~/.docker/config.json
{}
$ docker login -u <user>
Password:
Login Succeeded
$ cat ~/.docker/config.json
{}
# below is the file that docker cli actually created and wrote to, relative to the current working directory.
$ cat ./config-company.json
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "xxxxxxxx"
}
}
}
Expected behavior
docker cli should write to the absolute path of the symlink target.
docker version
Client: Docker Engine - Community
Version: 27.0.3
API version: 1.46
Go version: go1.21.11
Git commit: 7d4bcd8
Built: Sat Jun 29 00:02:23 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 27.0.3
API version: 1.46 (minimum version 1.24)
Go version: go1.21.11
Git commit: 662f78c
Built: Sat Jun 29 00:02:23 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.19
GitCommit: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
runc:
Version: 1.7.19
GitCommit: v1.1.13-0-g58aa920
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Description
When the config file is a relative symlink, docker cli can't handle it properly. Every config file writing operation, like
docker login
ordocker context use
, will take no effect on the real config file, but instead it creates a new file that relative to the current working directory.Reproduce
In a fresh new docker environment:
Expected behavior
docker cli should write to the absolute path of the symlink target.
docker version
Client: Docker Engine - Community Version: 27.0.3 API version: 1.46 Go version: go1.21.11 Git commit: 7d4bcd8 Built: Sat Jun 29 00:02:23 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 27.0.3 API version: 1.46 (minimum version 1.24) Go version: go1.21.11 Git commit: 662f78c Built: Sat Jun 29 00:02:23 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.19 GitCommit: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41 runc: Version: 1.7.19 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: