Closed adaoud-ims closed 3 years ago
Is this happening in any directory where you just type the docker
command? I could imagine this happening if a bind-mount was specified for a container, which was using ~
as path (or as part of a compose file), and the path was not evaluated by the shell.
I tried reproducing, but so far haven't been able to π€
Yes, in any directory. see below my screenshot in a empty dir :
Not sure why I have that behaviour. I removed docker desktop and reinstalled from scratch but still the same issue.
I was able to reproduce this by setting the DOCKER_CONFIG
environment variable to a path containing a literal ~
;
Create a directory for testing:
mkdir repro-3332
cd repro-3332
ls -la
total 0
drwxr-xr-x 2 sebastiaan staff 64 Oct 12 10:49 ./
drwxr-xr-x 261 sebastiaan staff 8352 Oct 12 10:51 ../
Set the DOCKER_CONFIG
variable to a literal ~/.docker
(using single quotes to prevent the shell from expanding it), and run a docker
command:
DOCKER_CONFIG='~/.docker' docker version
ls -la
total 0
drwxr-xr-x 3 sebastiaan staff 96 Oct 12 10:53 ./
drwxr-xr-x 261 sebastiaan staff 8352 Oct 12 10:51 ../
drwxr-xr-x 3 sebastiaan staff 96 Oct 12 10:53 ~/
tree -ad
.
βββ ~
βββ .docker
βββ contexts
βββ meta
4 directories
Could you check if you have that environment variable set (or any other env-variables related to docker that may be relevant?
thanks a lot ! it was the issue. I had the DOCKER_CONFIG set to '~/.docker'. Once removed, it was working properly.
π good to hear it's resolved!
Thanks for reporting the issue; it could have been a bug somewhere in our code (as handling these "special" paths is not always trivial)
Let me close this ticket
On MacOS, when running the docker command, I have the ~/.docker/contexts/meta directory created in my current folder.
How to reproduce
> docker
the command will create the ~/.docker/contexts/meta directly under my current folder
/Users/MYUSER/MYPROJECT/~/.docker/contexts/meta
the meta folder is empty.