@@ -183,6 +183,9 @@ common:
183183 search_backend: foo.registry.index.xapian
184184` ` `
185185
186+ In this case, the module is imported, and an instance of its `Index`
187+ class is used as the search backend.
188+
186189# ### sqlalchemy
187190
188191Use [SQLAlchemy][] as the search backend.
@@ -198,8 +201,14 @@ common:
198201 sqlalchemy_index_database: sqlite:////tmp/docker-registry.db
199202` ` `
200203
201- In this case, the module is imported, and an instance of its `Index`
202- class is used as the search backend.
204+ On initialization, the `SQLAlchemyIndex` class checks the database
205+ version. If the database doesn't exist yet (or does exist, but lacks
206+ a `version` table), the `SQLAlchemyIndex` creates the database and
207+ required tables. To avoid several Gunicorn workers racing to create
208+ the database, you should launch your registry with
209+ [--preload][gunicorn-preload]. For example :
210+
211+ $ docker run -e GUNICORN_OPTS='[--preload]' -p 5000:5000 registry
203212
204213# ## Mirroring Options
205214
@@ -338,3 +347,4 @@ Read [contributing](CONTRIBUTING.md)
338347[search-endpoint] : http://docs.docker.com/reference/api/docker-io_api/#search
339348[SQLAlchemy] : http://docs.sqlalchemy.org/
340349[create_engine] : http://docs.sqlalchemy.org/en/latest/core/engines.html#sqlalchemy.create_engine
350+ [gunicorn-preload] : http://gunicorn-docs.readthedocs.org/en/latest/settings.html#preload-app
0 commit comments