Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 972ecc4

Browse files
committed
README.md: Document --preload for the SQLAlchemy search index
1 parent 24c403f commit 972ecc4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ common:
201201
sqlalchemy_index_database: sqlite:////tmp/docker-registry.db
202202
```
203203

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
212+
204213
### Mirroring Options
205214

206215
All mirror options are placed in a `mirroring` section.
@@ -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

Comments
 (0)