简体   繁体   中英

Failed to start Docker container with image from GCP Container Registry

I'm trying to start a container using an image from Google Cloud Platform's Container Registry. But it returns this error message

Error: Status 405 trying to pull repository project/image: "v1 Registry API 
is disabled. If you are not explicitly using the v1 Registry API, it is 
possible your v2 image could not be found. Verify that your image is 
available, or retry with `dockerd --disable-legacy-registry`."

It also returns the same error when I run docker pull . I can push built images to the same registry without any problem, but can't pull for some reason.

I'm still new with Docker and docker-compose so I'm really not sure which part is wrong. These are my docker-compose file and Docker version:

version: '2'
services:
  web:
    image: 'asia.gcr.io/project/image:${tag}'

$ docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:10:36 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:10:36 2017
 OS/Arch:      linux/amd64
 Experimental: false

The tag exists in the registry

$ gcloud container images list-tags asia.gcr.io/project/image
DIGEST        TAGS      TIMESTAMP
8eb78a1ee2c8  0.3.84.1  2018-07-10T04:34:02
8e36423231ab  0.3.83.3  2018-06-26T09:17:45
004390b9b471  0.3.83.2  2018-06-26T08:05:37

I upgraded my Docker and docker-compose and now it works with no error. Not sure whats the actual cause of the problem as my other server still uses the above version and it works fine. Just want to leave this here for others who have this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM