I found the one installed with snap will fail to pull with credential error when providing DOCKER_CONFIG environment variable, it can read /root/snap/docker/2285/.docker successfully.
If I specify DOCKER_CONFIG when running docker pull, it will fail to pull and print errors, even though this directory's content is exactly same as /root/snap/docker/2285/.docker
$ DOCKER_CONFIG=/abc/ docker pull gcr.io/anthos-baremetal-release/ais@sha256:dbb50745df164659dc5701cfeb3ffb540f67b8defc8aacb5ed9062a11953114b
Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
The machine with normal docker installed doesn't have this issue.
Reproduce
Have a ubuntu 20.04
snap install docker
docker login gcr.io and input username and password
nvm, I found this is caused by docker installed by snap is in strict confinement mode: https://snapcraft.io/docs/snap-confinement, so it can't read the directory I provided.
Description
I have two ubuntu 20.04 servers, one have docker installed using 'snap install docker', another one followed https://docs.docker.com/engine/install/ubuntu/
I found the one installed with snap will fail to pull with credential error when providing
DOCKER_CONFIG
environment variable, it can read/root/snap/docker/2285/.docker
successfully.If I specify DOCKER_CONFIG when running docker pull, it will fail to pull and print errors, even though this directory's content is exactly same as
/root/snap/docker/2285/.docker
The machine with normal docker installed doesn't have this issue.
Reproduce
Expected behavior
docker pull successfully
docker version
docker info
Additional Info
No response