GCloud gives warning : `docker-credential-gcloud` not in system PATH

Problem :

On an Ubuntu VM, the Docker pulls from Gcloud private repository give the error

[bash]

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 r
equest, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication

[/bash]

After this to reconfigure auth, the following command is issued :

[bash]

gcloud auth configure-docker

[/bash]

This gives the error:

[bash]
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.
[/bash]

Solution:

Issue these commands on terminal

[bash]

sudo su

curl -fsSL “https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.5.0/docker-credential-gcr_linux_amd64-1.5.0.tar.gz” | tar xz –to-stdout ./docker-credential-gcr > /usr/bin/docker-credential-gcr && chmod +x /usr/bin/docker-credential-gcr

docker-credential-gcr configure-docker

docker pull <your-image>

[/bash]

The docker pulls should work now.

Sreekumar Kj
Sreekumar (KJ) has been a hobby programmer from school days. Codemarvels is his personal blog from the year 2010, where he writes about technology, philosophy, society and a bit about physics. He now runs a conversational AI company - DheeYantra - focusing his efforts to help businesses improve operational efficiency using digital employees powered by AI.