Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`docker-credential-gcloud` not in system PATH

After the latest updates to gcloud and docker I'm unable to access images on my google container repository. Locally when I run: gcloud auth configure-docker as per the instructions after updating gcloud, I get the following message:

WARNING: `docker-credential-gcloud` not in system PATH. gcloud's Docker credential helper can be configured but it will not work until this is corrected. gcloud credential helpers already registered correctly. 

Running which docker-credential-gcloud returns docker-credential-gcloud not found.

I have no other gcloud-related path issues and for the life of me can't figure out how to install/add docker-credential-gcloud to path. Here's what I have installed (shown via gcloud version):

Google Cloud SDK 197.0.0 beta 2017.09.15 bq 2.0.31 container-builder-local core 2018.04.06 docker-credential-gcr gsutil 4.30 

I also have Docker CE Version 18.03.0-ce-mac60 (23751).

Here's my $PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I also ran source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc on original gcloud install.

like image 892
ZaxR Avatar asked Apr 11 '18 16:04

ZaxR


People also ask

What is Docker credential GCR?

docker-credential-gcr is Google Container Registry's Docker credential helper. It allows for Docker clients v1. 11+ to easily make authenticated requests to GCR's repositories (gcr.io, eu.gcr.io, etc.).

What is Gcloud Docker?

The Google Cloud CLI Docker image lets you pull a specific version of gcloud CLI as a Docker image from Container Registry and quickly execute Google Cloud CLI commands in an isolated, correctly configured container. The Google Cloud CLI Docker image is the gcloud CLI installed on top of a Debian or Alpine image.


1 Answers

Notice: All docker-credential-gcr below can be replaced with docker-credential-gcloud. I think it is just different versions of gcloud, I might be wrong.

I used Homebrew Cask to install gcloud too. I installed docker-credential-gcr with

$ gcloud components install docker-credential-gcr 

And then like you said, which docker-credential-gcr doesn't gave you anything.

So I ran which gcloud to find there is a symlink to gcloud in /usr/local/bin. This symlink is created by Homebrew when you installed gcloud at first place. Now docker-credential-gcr wasn't installed by Homebrew but by gcloud itself, so there isn't a symlink.

I called readlink /usr/local/bin/gcloud and found out gcloud is installed in /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/.

Then:

$ ls /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin 

There you should see docker-credential-gcr listed there.

I simply linked it to /usr/local/bin:

$ ln -s \     /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/docker-credential-gcr \     /usr/local/bin/ 

Then run:

$ docker-credential-gcr configure-docker 

It should succeed.

like image 78
Xiwen Li Avatar answered Oct 04 '22 09:10

Xiwen Li