0

Docker-registry image is started in local machine. Images that are built are able to be pushed to docker-registry. However, when we do the restart of the registry, the pushed images are lost and not retained.

Started the container with --always tag.

No Code

Expected result would be to retain the images in the registry even after a restart of the docker-registry.

1 Answers1

2

Pick a directory on the host file system to store the images during registry downtime, and bindmount that into the registry upon restart.

So in your docker run for the registry, you need this:

-v /registry-storage:/var/lib/registry

you can name the lefthand directory anything you like. You must call the righthand side of the colon /var/lib/registry

scrypted
  • 79
  • 1
  • 4
  • 1
    Note that if you discover your error before stopping the initial container, you can retrieve the data with `docker cp :/var/lib/registry /registry-storage` before restarting it as explained above. – Kleag Apr 08 '22 at 15:32