I’m a bit confused about where the actual registry storage lives when you use the default filesystem:rootdirectory=/var/lib/registry. It seems like the storage is inside the container, because when I stop and remove the container then start it up again, any images that were in the registry before are completely gone. Does this mean I should be creating a volume somehow so the rootdirectory ends up pointing to a “real” dir outside the container in the host file system? Please clarify/advise.
Yep, like i though, you are in fact storing the data inside the container.
You need to add a -v /path/on/host:/var/lib/registry to your docker run command in order to persist the data outside your container. Replace /path/on/host with an existing valid path on your host.