Behebung von gcloud WARNING: `docker-credential-gcloud` not in system PATH

English Deutsch

Problem:

Du möchtest Docker so konfigurieren, dass es auf Google Container Registry zugreifen kann, indem du

gcloud_configure_docker.sh
gcloud auth configure-docker

aber du siehst diese Warnmeldung:

gcloud_warning.txt
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.

Lösung

Installiere docker-credential-gcloud mit

install_docker_credential_gcr.sh
sudo gcloud components install docker-credential-gcr

Falls du diese Fehlermeldung siehst:

gcloud_components_error.txt
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):

install_docker_credential_gcr_alt.sh
VERSION=1.5.0
OS=linux
ARCH=amd64

curl -fsSL "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v${VERSION}/docker-credential-gcr_${OS}_${ARCH}-${VERSION}.tar.gz" \
  | tar xz --to-stdout ./docker-credential-gcr \
  | sudo tee /usr/bin/docker-credential-gcr > /dev/null && sudo chmod +x /usr/bin/docker-credential-gcr

Danach konfiguriere Docker mit

docker-credential-gcr configure-docker

docker_credential_configure.sh
docker-credential-gcr configure-docker

Jetzt kannst du versuchen, deinen ursprünglichen Befehl erneut auszuführen.

For reference, see the official documentation.


Check out similar posts by category: Cloud, Container, Docker, Linux