Closed
Description
Description of the issue
Whenever I run docker-compose up
in my WSL 2 environment, it fails with the error:
docker.credentials.errors.InitializationError: docker-credential-desktop.exe not installed or not available in PATH
[519] Failed to execute script docker-compose
It's complaining that docker-credential-desktop is not available, however in the same session I can run docker-credential-desktop -h
and get the help text output.
I am also able to use docker run
to build and run my container without any problems.
Context information (for bug reports)
Output of docker-compose version
docker-compose version 1.25.5, build 8a1c60f6
docker-py version: 4.1.0
CPython version: 3.7.5
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
Output of docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:25:46 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Output of docker-compose config
(Make sure to add the relevant -f
and other flags)
services:
happy:
build:
context: /home/blake/repos/happy
dockerfile: Dockerfile
container_name: happy
environment:
CHOKIDAR_USEPOLLING: "true"
ports:
- published: 3001
target: 3000
volumes:
- /home/blake/repos/happy:/app:rw
- /app/node_modules
version: '3.7'
Steps to reproduce the issue
- Create a WSL 2 environment (I'm running Ubuntu 20.04)
- Install Docker Desktop
- Create a Dockerfile and attempt to run
docker-compose up
on it
Observed result
The above error message
Expected result
The container is built and run
Stacktrace / full error message
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
File "compose/cli/main.py", line 72, in main
File "compose/cli/main.py", line 128, in perform_command
File "compose/cli/main.py", line 1077, in up
File "compose/cli/main.py", line 1073, in up
File "compose/project.py", line 548, in up
File "compose/service.py", line 367, in ensure_image_exists
File "compose/service.py", line 1106, in build
File "site-packages/docker/api/build.py", line 261, in build
File "site-packages/docker/api/build.py", line 308, in _set_auth_headers
File "site-packages/docker/auth.py", line 301, in get_all_credentials
File "site-packages/docker/auth.py", line 287, in _get_store_instance
File "site-packages/docker/credentials/store.py", line 25, in __init__
docker.credentials.errors.InitializationError: docker-credential-desktop.exe not installed or not available in PATH
[519] Failed to execute script docker-compose
Additional information
OS version: Windows 10 version 2004 build 19041.264
WSL 2 distro: Ubuntu 20.04
The way I got my setup was:
- Installed WSL 2 with latest Windows update
- Installed Docker Desktop and enabled the WSL features
Activity
blake-mealey commentedon Jun 2, 2020
Update: something I didn't mention above was that I moved my WSL instance to my D drive (because my C drive is pretty full). I thought maybe that could cause problems so I just tried a fresh Ubuntu 20.04 install on the C drive and it seems to be working fine there. This is a temporary workaround which is fine for now but I would like the issue to be fixed still. Thanks :)
akhdanbuchou commentedon Jun 3, 2020
i have the same issue in Ubuntu 18.04, tried to reinstall both docker and the Ubuntu but still getting the same error.
Ahmed-Abudayyah commentedon Jun 7, 2020
same issue here, Im trying to run docker-compose up for this project.
https://github.com/big-data-europe/docker-hadoop
Ahmed-Abudayyah commentedon Jun 8, 2020
looks like they had same issue with mac.
docker/for-mac#3785
I just added _ before credsStore in this file ( ~/.docker/config.json ) {"_credsStore":"desktop.exe"}
I don't know what does that config do but I'm not getting the error anymore.
gaddman commentedon Jun 11, 2020
Removing the file worked for me:
rm ~/.docker/config.json
SewonYun commentedon Jun 12, 2020
I did this, and effect me
liuwenzhuang commentedon Jun 12, 2020
In my WSL2 Debian, I disable windows path, so I add docker-credential-desktop.exe path to
~/.bashrc
:and after run
source ~/.bashrc
, mydocker-compose
work well.ddjsecomea commentedon Jun 23, 2020
I have the same issue. I have tried removing the .docker/config.json, commenting out the credsStore attribute, and also adjusting the PATH as suggested above. None of them worked. The only thing that worked was putting the underscore ("_") in front of the credsStore attribute.
ankurash commentedon Jun 24, 2020
This worked for me. In ~/.docker/config.json, change
{"credsStore":"desktop.exe"}
to{"_credsStore":"desktop.exe"}
meymself commentedon Jul 11, 2020
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-credential-desktop.exe /usr/bin/docker-credential-desktop.exe
does this help? source: #6652 (comment)
lackovic commentedon Aug 3, 2020
I have the same issue.
All the three following solutions mentioned above remove the
docker.credentials.errors.InitializationError
error message:Renaming
credsStore
to anything in~/.docker/config.json
or deleting the file altogetheradding the path to
docker-credential-desktop.exe
path to thePATH
in~/.bashrc
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-credential-desktop.exe /usr/bin/docker-credential-desktop.exe
All the three solutions creates another issue, when trying to pull any image I get the following error:
ERROR: pull access denied, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
mattisdada commentedon Sep 1, 2020
This was working for me and I decided to do the factory reset to use Buildkit instead, then I started getting this issue. The solution in #6652 (comment) worked perfectly fine for me, but this workaround is pretty un-intuitive.
I hope once this moves into stable, this is addressed (what makes this even more un-intuitive is that none of the images are private, they are all from Docker Hub public)
edwinb24 commentedon Sep 4, 2020
I tried every potential solution above, and not of them work for me, except for adding "_" to credsStore in this file ~/.docker/config.json: {"_credsStore":"desktop.exe"}
jpolania commentedon Sep 26, 2020
It happens when I have my fedora native Linux on the same computer of Windows 10 and pointed out same HOME folder both on Windows and Linux
technatelogy commentedon Nov 10, 2020
I had a similar issue after switching from edge to stable, but my error was very different. The only reason I found this thread was I noticed it would hang after looking for the auth entry. Changing the credsStore key fixed my issue but my original error message was this:
failed to create file hook: while creating logrus local file hook: unable to get 'APPDATA'
14 remaining items
zwass commentedon Mar 22, 2021
FWIW the issue title should perhaps be changed to
docker-compose up fails in many environments
. We can consistently reproduce this in a macOS environment.AndreasTraut commentedon May 3, 2021
I had the same issue some days ago and renaming
{"credsStore":"desktop.exe"}
to{"_credsStore":"desktop.exe"}
solved my issue for the moment. Some days later, when I came back to the same docker container and wanted to continue my work, I received a lot of different error messages. One was:"ERROR [internal] load metadata for docker.io/library/python:3.8-slim-buster"
. So I deleted the"~/.docker/config.json"
without knowing what whill happen, but it solved the problem again. So I will delete the"~/.docker/config.json"
each time in the future, when I have an error. Seems like the old CTRL+ ALT+ DEL, which solves nearly all problems. :-)What I did not like in this issue: the error messages are misleading an did not direct me towards the "config.json" file.
dukekautington3rd commentedon May 19, 2021
I have the same issue although, my conditions are a little bit different:
"_credsStore":"desktop.exe"
to/etc/docker/daemon.json
makes dockerd fail to start. I added because it didn't exist in the first placedocker pull [image]
beforedocker-compose up
.It seems that compose has trouble finding the binary required to auth to a registry.
ThomasTopuz commentedon Sep 5, 2021
This worked for me, thanks
saiqulhaq commentedon Nov 6, 2021
it works if I pull the image first, then
docker compose up
ealanisg commentedon Jan 17, 2022
This worked for me, no need of using sudo after, just
docker-compise build
docker-robott commentedon Apr 17, 2022
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with
/remove-lifecycle stale
comment.Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an
/lifecycle frozen
comment.If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale
Andrew-Staves-Activ commentedon May 17, 2022
This is still happening for me - I'm having to run
rm ~/.docker/config.json
each time I start Docker. (Not sure how to re-open the issue.)/remove-lifecycle stale
docker-robott commentedon Jun 16, 2022
Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked