Docker / GCloud | How to fix docker-credential-gcloud not installed or not available in PATH?
I am trying to do a simple docker-compose command. But the console errors with that:
Building patch-panel
Traceback (most recent call last): File "bin/docker-compose", line 6, in <module> File "compose/cli/main.py", line 71, in main File "compose/cli/main.py", line 127, in perform_command File "compose/cli/main.py", line 1080, in up File "compose/cli/main.py", line 1076, in up File "compose/project.py", line 475, in up File "compose/service.py", line 358, in ensure_image_exists File "compose/service.py", line 1082, in build File "site-packages/docker/api/build.py", line 251, in build File "site-packages/docker/api/build.py", line 313, in _set_auth_headers File "site-packages/docker/auth.py", line 96, in resolve_authconfig File "site-packages/docker/auth.py", line 127, in _resolve_authconfig_credstore File "site-packages/dockerpycreds/store.py", line 25, in __init__
dockerpycreds.errors.InitializationError: docker-credential-gcloud not installed or not available in PATH
[4167] Failed to execute script docker-composeI am reading that something is wrong with the pip installer, and python versions. But I have 2 problems. I am on WSL(Linux), and this is a little bit tricky as steps are missings from the solutions and I am not familiar with docker. I just want to do a docker-compose, and I can't. Can someone tell me how to fix it?
Some info on my system:
After doing gcloud info
Google Cloud SDK [232.0.0]
Platform: [Linux, x86_64] ('Linux', 'DESKTOP-OF5642B', '4.4.0-18329-Microsoft', '#1-Microsoft Tue Jan 29 15:04:00 PST 2019', 'x86_64', '')
Python Version: [2.7.15+ (default, Nov 28 2018, 16:27:22) [GCC 8.2.0]]
Python Location: [/usr/bin/python2]
Site Packages: [Disabled]
Installation Root: [/c/Users/Efsta/AppData/Local/Google/Cloud SDK/google-cloud-sdk]
Installed Components: docker-credential-gcr: [] core: [2019.01.27] gsutil: [4.35] bq: [2.0.40]
System PATH: [/home/efsta/go//bin:/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/c/ProgramData/DockerDesktop/version-bin:/c/Program Files/Docker/Docker/Resources/bin:
/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS/:/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS/:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/c/WI
NDOWS/System32/OpenSSH/:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Fil
es/Intel/Intel(R) Management Engine Components/IPT:/c/Users/Efsta/scoop/shims:/c/Users/Efsta/AppData/Local/Microsoft/WindowsApps:/c/Users/Efsta/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/Efsta/AppData/Local/Google/Cloud SDK/google-clo
ud-sdk/bin:/home/efsta/.dotnet/tools]
Python PATH: [/c/Users/Efsta/AppData/Local/Google/Cloud SDK/google-cloud-sdk/lib/third_party:/c/Users/Efsta/AppData/Local/Google/Cloud SDK/google-cloud-sdk/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk
:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload]
Cloud SDK on PATH: [True]
Kubectl on PATH: [False]
Installation Properties: [/c/Users/Efsta/AppData/Local/Google/Cloud SDK/google-cloud-sdk/properties]
User Config Directory: [/home/efsta/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/home/efsta/.config/gcloud/configurations/config_default]
Account: []
Project: [k8-engine]
Current Properties: [core] project: [k8-engine] account: [] disable_usage_reporting: [True]
Logs Directory: [/home/efsta/.config/gcloud/logs]
Last Log File: [/home/efsta/.config/gcloud/logs/2019.02.04/02.22.49.856181.log]
git: [git version 2.20.1]
ssh: [OpenSSH_7.9p1 Debian-5, OpenSSL 1.1.1a 20 Nov 2018]After doing gcloud --version:
Google Cloud SDK 232.0.0
bq 2.0.40
core 2019.01.27
docker-credential-gcr
gsutil 4.35Docker info and docker compose version:
Containers: 0 Running: 0 Paused: 0 Stopped: 0
Images: 2
Server Version: 18.09.1
Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 96ec2177ae841256168fcf76954f7177af9446eb
init version: fec3683
Security Options: seccomp Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: linuxkit-00155d010201
ID: 4TYN:GKJ7:IX2L:JZDX:IFSU:CSME:6VEU:3SRL:4LD2:NZCB:NYDL:DTUA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true File Descriptors: 22 Goroutines: 46 System Time: 2019-02-04T00:28:06.9845313Z EventsListeners: 1
Registry:
Labels:
Experimental: false
Insecure Registries: 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Enginedocker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f 25 May 2017 1 5 Answers
I had the same exact issue. Deleting ~/.docker/config.json fixed it for me right away. See here: .
Opening ~/.docker/config.json and removing the credHelpers object fixed it for me.
I had the issue. Following @adstwlearn answer, I checked the ~/.docker/config.json file and one the entries in "credHelpers" was refering to "gcloud" instead of "gcr". Changing it was enough to fix without the need to reconfigure anything after.
If you are using gcloud run the following command
gcloud auth configure-dockerit should update the credHelpers in .docker/config.json
that fixed it for me.
I had the same issue. I am on Ubuntu 16.04 and had installed the SDK using apt-get, and the dependency docker-credential-gcr wasn't available through apt-get by the time I'm writing this answer.
I solved it by uninstalling gcloud from apt-get and using the Google Cloud SDK Installer script ():
curl > install.sh
bash install.sh --disable-prompts
~/google-cloud-sdk/install.shThen I closed and reopened the terminal, tried to run docker-compose again and it worked perfectly.