Hi All, I am trying to create a docker private registry. *command* : docker run . . .

Sonal Kumar:
Hi All,
I am trying to create a docker private registry.
command : docker run -d -p 5000:5000 -v /docker_data/images:/var/lib/registry -v /docker_data/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key --restart on-failure --name docker-pvt-registry registry

But my container is restarting.
And in logs I am getting following error as below screenshot.
I am unable to find anything missing in my command…can anyone help me identify what am I missing…?

Sonal Kumar:
“/docker_data/certs” this path of certificate on host/docker host is correct.

Sonal Kumar:

image.png

Vamsee Krishna:
try passing full path from /docker_data

Sonal Kumar:
@Vamsee Krishna
My full path was /docker_data/certs on docker host.
I tried changing the path, and executed the same on home directory it worked.
Then I compared the permissions on both the directories, by keeping it same and tried again but I am still getting same error.

Vamsee Krishna:
But here you are not giving “/docker_data”

REGISTRY_HTTP_TLS_KEY=/certs/domain.key

Vamsee Krishna:
If you are runnig the docker command from inside /docker_data/certs. Try giving like this…

REGISTRY_HTTP_TLS_CERTIFICATE= domain.crt

Dont give any path.

Vamsee Krishna:
This is happening because certs is a directory inside /docker_data not under root ‘/’ so if you mention /certs it will not work