0

I am hosting an own registry.
After rebooting the Server my registry container is unable to start.

I used this command to start the registry

docker run -d -p 5000:5000 --name registry -v /var/lib/registry/:/var/lib/registry -v /root/certs:/certs -v /root/auth/:/auth -eEGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_ADDR=0.0.0.0:5000 -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH=htpasswd" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" --restart always registry:2.7.1

After a reboot i get this message when i try "docker start registry":

Error response from daemon: OCI runtime create failed: container with id exists: dfb0bef21bdfc8a89b59498befd37f83513e75527c0beb552e0400df2a2b7c7d: unknown Error: failed to start containers: registry

Starting a new container works fine.
How can a fix, it and sould the container not start by itself because of "--restart alway"

docker --version

Docker version 18.09.6, build 481bc77

Thx for your help.

Update

Intesting news I have written an init script to to the job, but the problem is exactly the same. The container exists but isn't started. If I try to start it, I get the error message from above.

On the boot screen in get this information. enter image description here

So the docker daemon seam to be not ready.
Do you have any suggestions why?

4

1 Answer 1

1

Try to check is registry really stopped using docker ps -a if container runned stop container then start.

Part related to the --restart always option, restart always will proceed only if container works at least 10 seconds and docker itself can monitor this service.

See more info at this link restart policy detail

1
  • Yes, docker ps -a returns the registry, container. Restart always should start the container after the service is restarted and after a reboot this is the case. Commented Jun 4, 2019 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.