distribution: Push to v2 registry with local storage location failed
Hi,
I’m using docker registry version 2.1.1/docker client 1.8.2. I started the registry with the following parameter
docker run -d -p 5000:5000 --name bregistry -v pwd/data:/var/lib/registry registry:2
When I push an image to the registry, I got the following error [otter@volcano registry]$ docker push volcano:5000/hello-world The push refers to a repository [volcano:5000/hello-world](len: 1) Sending image list Error: Status 503 trying to push repository hello-world: "{"errors":[{"code":"UNAVAILABLE","message":"service unavailable","detail":"health check failed: please see /debug/health"}]}\n
If I start registry withour the “-v” option, the push completed successfully. Am I miss anything?
Also, how can I access the /debug/health?
regards, Jerry
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15
If you do this, your images will be gone on restart.
This looks like a permissions issue for the volume. @jerrykwchan solved it with
--privilegedbecause it ran the container as root (or docker), giving access to the/var/lib/registryvolume.The trick here is to ensure that the registry has access to
/var/lib/registry. Either/var/lib/registryshould be owned by the registry user, or as part of the group that provides write access to the volume. This can be done with-uset to the user that owns/var/lib/registry.Thanks, I am not sure what does the
--privilegeddoes, but it didn’t solve this error. I had to remove image and rebuild. Btw are you using basic auth behind a nginx proxy or straight from the registry (or both) ?` curl --insecure https://registry.service.consul:5001/debug/health
{“errors”:[{“code”:“UNAVAILABLE”,“message”:“service unavailable”,“detail”:“health check failed: please see /debug/health”}]} `
Replace http or https appropriately. It doesn’t give you much more than you already have “docker logs” against the registry container shows me more.
I add “–privileged” option in docker run command and I can push to the registry successfully.