Sep 16

Docker Volumes Quirk

I discovered something interesting today regarding Docker and volumes — there’s a problem below with the call to run the private docker registry container:

docker run -d -v /opt/registry-cache/:/tmp/registry -p 5000:5000 registry

If you run that and curl -s http://localhost:5000, nothing is returned.

As it turns out, the trailing slash in /opt/registry-cache/ causes issues — the web proxy starts up, but the actual registry doesn’t run. In order to get it to work, the following needs to be done:

docker run -d -v /opt/registry-cache:/tmp/registry -p 5000:5000 registry

It’s amazing the difference a single character can make. Remove the extra '/' and it works as expected.

Leave a Reply

%d bloggers like this: