Docker Community Forums

Share and learn in the Docker community.

Local registry local filesystem issue


(Frank) #1

I’m just starting to learn Docker and I have set-up a private registry per https://docs.docker.com/registry/deploying/. All is fine except when I try to change the actual storage location from the default to some other file location. I want/need to use a local file system .
If I do:
docker run -d -p 5000:5000 --restart=always --name csiareg
-v pwd/certs:/certs
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/mydomain.crt
-e REGISTRY_HTTP_TLS_KEY=/certs/mydomain.key
registry:2
then a docker push. The files seem to be placed in /var/lib/docker. But all works fine

If I do this to direct to another directory it fails:
docker run -d -p 5000:5000 --restart=always --name csiareg
-v pwd/data:/var/lib/registry
-e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data
-v pwd/certs:/certs
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/mydomain.crt
-e REGISTRY_HTTP_TLS_KEY=/certs/mydomain.key
registry:2

When I do a docker push I get a : Received unexpected HTTP status: 503 Service Unavailable
Do a docker ps and container is running but I guess something failed. Not sure where to look and why this did not work.

Any thoughts?


(Frank) #2

Well I added some new env variables and the error of service unavailable went away but still does not store container pushed to the root directory location. found this link that lead me to beleive that is why my env had no effect on location but still same results, stores in default location.

docker run -d -p 5000:5000 --restart=always --name csiareg
-e REGISTRY_STORAGE=filesystem
-v pwd/data:/var/lib/registry
-e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somedir/data
-v pwd/certs:/certs
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/mydomain.crt
-e REGISTRY_HTTP_TLS_KEY=/certs/mydomain.key
registry:2