I have setup a docker private registry with using registry:2 image in OEL6 using below command.
docker run -d -p 5000:5000 --restart=always --name bkdevregistry -v /var/lib/docker/certs/:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/xx.yy.com.crt -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/xx.yy.com.key registry:2
I have followed the official guide to create the certificates and setting up the registry.
The system got rebooted due to maintenance activities and after rebooting, the registry container is not working at all. It's immediately going to the Restarting (1)
status and is not changing its status.
[root@slcn09vmf0022 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44ad9d09d210 registry:2 "/bin/registry /etc/d" 9 minutes ago Restarting (1) 3 minutes ago 0.0.0.0:5000->5000/tcp blkdevreg
Any suggestion to bring it to normal will be appreciated.
The log:
time="2016-05-18T15:29:34Z" level=fatal msg="open : no such file or directory"
time="2016-05-18T17:18:47Z" level=warning msg="No HTTP secret provided - generated random secret. This may cause problems with uploads if multiple registries are behind a load-balancer. To provide a shared secret, fill in http.secret in the configuration file or set the REGISTRY_HTTP_SECRET environment variable." go.version=go1.5.3 instance.id=7034ae26-a1e8-4bc4-828a-be38d17a7ebb version=v2.3.1
time="2016-05-18T17:18:47Z" level=info msg="redis not configured" go.version=go1.5.3 instance.id=7034ae26-a1e8-4bc4-828a-be38d17a7ebb version=v2.3.1
time="2016-05-18T17:18:47Z" level=info msg="Starting upload purge in 51m0s" go.version=go1.5.3 instance.id=7034ae26-a1e8-4bc4-828a-be38d17a7ebb version=v2.3.1
time="2016-05-18T17:18:47Z" level=info msg="using inmemory blob descriptor cache" go.version=go1.5.3 instance.id=7034ae26-a1e8-4bc4-828a-be38d17a7ebb version=v2.3.1
Use a restart policy Restart the container if it exits due to an error, which manifests as a non-zero exit code. Optionally, limit the number of times the Docker daemon attempts to restart the container using the :max-retries option.
A private Docker registry allows you to share your custom base images within your organization, keeping a consistent, private, and centralized source of truth for the building blocks of your architecture.
docker run -d -p 5000:5000 --restart=always --name bkdevregistry -v /var/lib/docker/certs/:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/xx.yy.com.crt -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/xx.yy.com.key registry:2
The problem is due to incorrect use of REGISTRY_HTTP_TLS_CERTIFICATE
environment variable for both CERT and KEY as well.
For key use REGISTRY_HTTP_TLS_KEY
try delete docker registry and restart docker service and iptables, then rerun docker private registry with using registry:2 ,use docker logs container_id to see the error repeated in the log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With