Почему я не могу запустить докер-контейнер в моей облачной devshell? - PullRequest
0 голосов
/ 09 июня 2018

Я следую учебному пособию на https://cloud.google.com/container-builder/docs/quickstart-docker.Я построил образ, и он помещается в реестр Google gcr.io.

$ gcloud auth configure-docker
gcloud credential helpers already registered correctly.

$ docker run --init gcr.io/foo-bar-111111/quickstart-image
Unable to find image 'gcr.io/foo-bar-111111/quickstart-image:latest' locally
docker: 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 request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication.
See 'docker run --help'.

$ docker-credential-gcr configure-docker
/home/wonderwoman/.docker/config.json configured to use this credential helper for GCR registries

$ docker run --init gcr.io/foo-bar-111111/quickstart-image
Unable to find image 'gcr.io/foo-bar-111111/quickstart-image:latest' locally
docker: 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 request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication.
See 'docker run --help'.

$ docker pull gcr.io/foo-bar-111111/quickstart-image:latest
Please login prior to pull:
error getting credentials - err: exit status 1, out: `docker-credential-gcr/helper: could not retrieve GCR's access token: credentials not found in native keychain`

Что я пропустил?

1 Ответ

0 голосов
/ 24 июня 2018

Вы используете gcloud в качестве помощника учетных данных Docker :

gcloud auth configure-docker

Таким образом, вы должны использовать gcloud docker до docker pull вашего изображения изреестр докеров.gcloud docker все еще использует Docker внизу, но вводит клиента Docker с учетными данными реестра контейнеров перед передачей в Docker.

Используя ваш пример:

gcloud docker pull gcr.io/foo-bar-111111/quickstart-image:latest

Скорее всего, вам придется использовать sudo тоже, сделав полную команду:

sudo gcloud docker pull gcr.io/foo-bar-111111/quickstart-image:latest
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...