在Compute引擎中有CoreOS的VM和Container Registry里面的图像。
我遵循此说明https://cloud.google.com/container-registry/docs/advanced-authentication并运行
$ docker login -e [email protected] -u oauth2accesstoken -p "$(gcloud auth print-access-token)" https://gcr.io Flag --email has been deprecated, will be removed in 1.13. Login Succeeded $ docker pull gcr.io/myproject/web:v1.0.0 v1.0.0: Pulling from myproject/web 709515475419: Pulling fs layer 943e0887e008: Pulling fs layer c99fe67ba1a0: Pulling fs layer 2cfe3fdc59a2: Waiting 2c5b377ae620: Waiting dc0cee14b1bf: Waiting error pulling image configuration: unauthorized: authentication required
我试图检查身份validation
$ docker info Containers: 10 Running: 0 Paused: 0 Stopped: 10 Images: 2 Server Version: 1.12.6 Storage Driver: overlay Backing Filesystem: extfs Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: null host bridge overlay Swarm: inactive Runtimes: runc Default Runtime: runc Security Options: seccomp selinux Kernel Version: 4.9.9-coreos-r1 Operating System: Container Linux by CoreOS 1298.6.0 (Ladybug) OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 3.618 GiB Name: ********************** ID: ********************** Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Insecure Registries: 127.0.0.0/8
docker login有什么问题,为什么它报告成功login,但gcr.io不会出现在docker info ?
我find了另一种方法:使用gcloud docker -- pull gcr.io/myproject/web:v1.0.0
由于运行在容器内的gcloud没有finddocker。 为了解决我使用以下内容:
alias gcloud='(docker images google/cloud-sdk || docker pull google/cloud-sdk) > /dev/null;docker run --rm -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'