docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 879 forks source link

Registry catalog doesn't survive a restart #895

Open igormoochnick opened 9 years ago

igormoochnick commented 9 years ago

Our registry is configured to store all the images on a mounted NAS file system and is hosted in it's own Docker image. It is configured with SQLAlchemy for search.

When the registry container is restarted, it's coming clean - doesn't know anything about previously stored images on the mounted NAS, even though, all the files and folders are still there.

Is it even possible to seed the registry on start from the stored files? I have a feeling that it's a missing issue with the SQLAlchemy - it's not preserving the information between the restarts, right? Is it possible to overcome?

dmp42 commented 9 years ago

SqlAlchemy configuration let you specify where your database live: https://github.com/docker/docker-registry#sqlalchemy

By mounting that database file from a volume, it will survive container destruction.

Does that answer your question?

igormoochnick commented 9 years ago

Can this file be shared across multiple registries? (i.e. HA configuration) If the file get corrupted, can it be reseeded?

dmp42 commented 9 years ago

If you want that, then don't use sqlite - but instead postgres / mysql / other. More about that in the SQLAlchemy documentation.