@@ -183,6 +183,9 @@ common:
183
183
search_backend: foo.registry.index.xapian
184
184
` ` `
185
185
186
+ In this case, the module is imported, and an instance of its `Index`
187
+ class is used as the search backend.
188
+
186
189
# ### sqlalchemy
187
190
188
191
Use [SQLAlchemy][] as the search backend.
@@ -198,8 +201,14 @@ common:
198
201
sqlalchemy_index_database: sqlite:////tmp/docker-registry.db
199
202
` ` `
200
203
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
203
212
204
213
# ## Mirroring Options
205
214
@@ -338,3 +347,4 @@ Read [contributing](CONTRIBUTING.md)
338
347
[search-endpoint] : http://docs.docker.com/reference/api/docker-io_api/#search
339
348
[SQLAlchemy] : http://docs.sqlalchemy.org/
340
349
[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