0 votes
1 view
in GCP by (24.8k points)
recategorized by

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 the 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. 

1 Answer

+1 vote
by (63k points)
selected by
 
Best answer

Install docker-credential-gcloud using

sudo gcloud components install docker-credential-gcr

In case you see this error message:
ERROR: (gcloud.components.install) You cannot perform this action because this Cloud SDK installation is managed by an external package manager.

 Please consider using a separate installation of the Cloud SDK created through the default mechanism described at https://cloud.google.com/sdk/

Use this alternate installation command instead (this command is for Linux, see the official documentation for other operating systems):

VERSION=1.5.0
OS=linux
ARCH=amd64
 | tar xz --to-stdout ./docker-credential-gcr \
 | sudo tee /usr/bin/docker-credential-gcr > /dev/null && sudo chmod +x /usr/bin/docker-credential-gcr

 After that, configure docker using

docker-credential-gcr configure-docker

 Now you can retry running your original command

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...