5

I'm at my wits trying to get Docker images from Google Container Registry onto a Google Compute Engine instance. (The images I need have been successfully uploaded to GCR.)

  1. I've logged in using gcloud auth login and then tried gcloud docker pull -- us.gcr.io/app-999/app which results in ERROR: (gcloud.docker) Docker is not installed..

  2. I've tried to authenticate using oauth and pulling via a normal docker call. I see my credentials when I look at the file at .docker/config.json. Doing that, it looks like it's going to work, but ultimatly ends like this:

    mbname@instance-1 ~ $ docker pull -- us.gcr.io/app-999/app Using default tag: latest latest: Pulling from app-999/app b7f33cc0b48e: Pulling fs layer 43a564ae36a3: Pulling fs layer b294f0e7874b: Pulling fs layer eb34a236f836: Waiting error pulling image configuration: unauthorized: authentication required

which looks like progress, because at least it attempted to download something.

I've tried both of these things on my local machine as well and both methods were successful.

Am I missing something?

Thanks for your help.

P.S. I've also tried loading a container from another registry ( Docker Hub) and that worked fine, but I need more than one container and want to keep expenses down.

mmbb
  • 327
  • 4
  • 12

2 Answers2

7

After contacting Google support they informed me that there is a bug in the CoreOS gcloud alias. This bug is fixed by overwriting the alias in the shell as follows:

alias gcloud='(docker images google/cloud-sdk || docker pull google/cloud-sdk) > /dev/null;docker run -t -i --net=host -v $HOME/.config:/.config -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker google/cloud-sdk gcloud'

I've tried this and it works now.

mmbb
  • 327
  • 4
  • 12
0

docker should be included in the latest versions of gcloud. You can update to the latest version of gcloud by running gcloud components update

Victor
  • 76
  • 1
  • 1
    Running `mbname@instance-1 ~ $ gcloud components update` yields `You cannot perform this action because this Cloud SDK installation is managed by an external package manager. If you would like to get the latest version, please see our main download page at: https://cloud.google.com/sdk/ ERROR: (gcloud.components.update) The component manager is disabled for this installation` – mmbb Jan 19 '17 at 20:35
  • It won't work if the host doesn't have gcloud as well. – Oliver Dixon Aug 12 '22 at 14:40