Format configuration.md with code fences to avoid render issues

Signed-off-by: Joao Fernandes <joao.fernandes@docker.com>
This commit is contained in:
Joao Fernandes 2016-12-14 18:50:40 -08:00
parent 923c7763b0
commit a24f2a6d78

View file

@ -17,13 +17,17 @@ To override a configuration option, create an environment variable named
and the `_` (underscore) represents indention levels. For example, you can
configure the `rootdirectory` of the `filesystem` storage backend:
```
storage:
filesystem:
rootdirectory: /var/lib/registry
```
To override this value, set an environment variable like this:
```
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere
```
This variable overrides the `/var/lib/registry` value to the `/somewhere`
directory.
@ -36,9 +40,11 @@ If the default configuration is not a sound basis for your usage, or if you are
Typically, create a new configuration file from scratch, and call it `config.yml`, then:
```
docker run -d -p 5000:5000 --restart=always --name registry \
-v `pwd`/config.yml:/etc/docker/registry/config.yml \
registry:2
```
You can (and probably should) use [this as a starting point](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml).
@ -48,6 +54,7 @@ This section lists all the registry configuration options. Some options in
the list are mutually exclusive. So, make sure to read the detailed reference
information about each option that appears later in this page.
```
version: 0.1
log:
accesslog:
@ -257,6 +264,7 @@ information about each option that appears later in this page.
- ^https?://([^/]+\.)*example\.com/
deny:
- ^https?://www\.example\.com/
```
In some instances a configuration option is **optional** but it contains child
options marked as **required**. This indicates that you can omit the parent with
@ -265,7 +273,9 @@ the children marked **required**.
## version
```
version: 0.1
```
The `version` option is **required**. It specifies the configuration's version.
It is expected to remain a top-level field, to allow for a consistent version
@ -277,6 +287,7 @@ The `log` subsection configures the behavior of the logging system. The logging
system outputs everything to stdout. You can adjust the granularity and format
with this configuration section.
```
log:
accesslog:
disabled: true
@ -285,6 +296,7 @@ with this configuration section.
fields:
service: registry
environment: staging
```
<table>
<tr>
@ -335,8 +347,10 @@ with this configuration section.
### accesslog
```
accesslog:
disabled: true
```
Within `log`, `accesslog` configures the behavior of the access logging
system. By default, the access logging system outputs to stdout in
@ -345,6 +359,7 @@ Access logging can be disabled by setting the boolean flag `disabled` to `true`.
## hooks
```
hooks:
- type: mail
levels:
@ -358,6 +373,7 @@ Access logging can be disabled by setting the boolean flag `disabled` to `true`.
from: name@sendhost.com
to:
- name@receivehost.com
```
The `hooks` subsection configures the logging hooks' behavior. This subsection
includes a sequence handler which you can use for sending mail, for example.
@ -367,13 +383,16 @@ Refer to `loglevel` to configure the level of messages printed.
> **DEPRECATED:** Please use [log](#log) instead.
```
loglevel: debug
```
Permitted values are `error`, `warn`, `info` and `debug`. The default is
`info`.
## storage
```
storage:
filesystem:
rootdirectory: /var/lib/registry
@ -436,12 +455,13 @@ Permitted values are `error`, `warn`, `info` and `debug`. The default is
dryrun: false
redirect:
disable: false
```
The storage option is **required** and defines which storage backend is in use.
You must configure one backend; if you configure more, the registry returns an error. You can choose any of these backend storage drivers:
| Storage&nbsp;driver | Description
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Storage&nbsp;driver | Description |
|:--------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `filesystem` | Uses the local disk to store registry files. It is ideal for development and may be appropriate for some small-scale production applications. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/filesystem.md). |
| `azure` | Uses Microsoft's Azure Blob Storage. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/azure.md). |
| `gcs` | Uses Google Cloud Storage. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/gcs.md). |
@ -460,7 +480,9 @@ backing data-store. If you do use a Windows volume, you must ensure that the
`PATH` to the mount point is within Windows' `MAX_PATH` limits (typically 255
characters). Failure to do so can result in the following error message:
```
mkdir /XXX protocol error and your registry will not function properly.
```
### Maintenance
@ -476,12 +498,12 @@ configure upload directory purging, the following parameters
must be set.
| Parameter | Required | Description
--------- | -------- | -----------
`enabled` | yes | Set to true to enable upload purging. Default=true. |
`age` | yes | Upload directories which are older than this age will be deleted. Default=168h (1 week)
`interval` | yes | The interval between upload directory purging. Default=24h.
`dryrun` | yes | dryrun can be set to true to obtain a summary of what directories will be deleted. Default=false.
| Parameter | Required | Description |
|:-----------|:---------|:---------------------------------------------------------------------------------------------------|
| `enabled` | yes | Set to true to enable upload purging. Default=true. |
| `age` | yes | Upload directories which are older than this age will be deleted. Default=168h (1 week) |
| `interval` | yes | The interval between upload directory purging. Default=24h. |
| `dryrun` | yes | dryrun can be set to true to obtain a summary of what directories will be deleted. Default=false. |
Note: `age` and `interval` are strings containing a number with optional fraction and a unit suffix: e.g. 45m, 2h10m, 168h (1 week).
@ -501,8 +523,10 @@ Use the `delete` subsection to enable the deletion of image blobs and manifests
by digest. It defaults to false, but it can be enabled by writing the following
on the configuration file:
```
delete:
enabled: true
```
### cache
@ -530,12 +554,14 @@ doing aggressive caching.
Redirects can be disabled by adding a single flag `disable`, set to `true`
under the `redirect` section:
```
redirect:
disable: true
```
## auth
```
auth:
silly:
realm: silly-realm
@ -548,6 +574,7 @@ under the `redirect` section:
htpasswd:
realm: basic-realm
path: /path/to/htpasswd
```
The `auth` option is **optional**. There are
currently 3 possible auth providers, `silly`, `token` and `htpasswd`. You can configure only
@ -712,6 +739,7 @@ object they're wrapping. This means a registry middleware must implement the
An example configuration of the `cloudfront` middleware, a storage middleware:
```
middleware:
registry:
- name: ARegistryMiddleware
@ -728,6 +756,7 @@ An example configuration of the `cloudfront` middleware, a storage middleware:
privatekey: /path/to/pem
keypairid: cloudfrontkeypairid
duration: 3000s
```
Each middleware entry has `name` and `options` entries. The `name` must
correspond to the name under which the middleware registers itself. The
@ -798,11 +827,12 @@ storage middleware can be used to specify a custom URL to a location
of a proxy for the layer stored by the S3 storage driver.
| Parameter | Required | Description |
| --- | --- | --- |
|:----------|:---------|:------------------------------------------------------------------------------------------------------------|
| baseurl | yes | `SCHEME://HOST` at which layers are served. Can also contain port. For example, `https://example.com:5443`. |
## reporting
```
reporting:
bugsnag:
apikey: bugsnagapikey
@ -812,6 +842,7 @@ of a proxy for the layer stored by the S3 storage driver.
licensekey: newreliclicensekey
name: newrelicname
verbose: true
```
The `reporting` option is **optional** and configures error and metrics
reporting tools. At the moment only two services are supported, [New
@ -909,6 +940,7 @@ configuration may contain both.
## http
```
http:
addr: localhost:5000
net: tcp
@ -931,6 +963,7 @@ configuration may contain both.
X-Content-Type-Options: [nosniff]
http2:
disabled: false
```
The `http` option details the configuration for the HTTP server that hosts the registry.
@ -1164,6 +1197,7 @@ settings for the registry.
## notifications
```
notifications:
endpoints:
- name: alistener
@ -1175,6 +1209,7 @@ settings for the registry.
backoff: 1000
ignoredmediatypes:
- application/octet-stream
```
The notifications option is **optional** and currently may contain a single
option, `endpoints`.
@ -1306,6 +1341,7 @@ The URL to which events should be published.
## redis
```
redis:
addr: localhost:6379
password: asecret
@ -1317,6 +1353,7 @@ The URL to which events should be published.
maxidle: 16
maxactive: 64
idletimeout: 300s
```
Declare parameters for constructing the redis connections. Registry instances
may use the Redis instance for several applications. The current purpose is
@ -1404,10 +1441,12 @@ as the registry does not set an expire value on keys.
### pool
```
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
```
Configure the behavior of the Redis connection pool.
@ -1456,6 +1495,7 @@ Configure the behavior of the Redis connection pool.
## health
```
health:
storagedriver:
enabled: true
@ -1477,6 +1517,7 @@ Configure the behavior of the Redis connection pool.
timeout: 3s
interval: 10s
threshold: 3
```
The health option is **optional**. It may contain preferences for a periodic
health check on the storage driver's backend storage, and optional periodic
@ -1785,10 +1826,12 @@ The TCP address to connect to, including a port number.
## Proxy
```
proxy:
remoteurl: https://registry-1.docker.io
username: [username]
password: [password]
```
Proxy enables a registry to be configured as a pull through cache to the official Docker Hub. See [mirror](https://github.com/docker/docker.github.io/tree/master/registry/recipes/mirror.md) for more information. Pushing to a registry configured as a pull through cache is currently unsupported.
@ -1837,9 +1880,11 @@ To enable pulling private repositories (e.g. `batman/robin`) a username and pass
## Compatibility
```
compatibility:
schema1:
signingkeyfile: /etc/registry/key.json
```
Configure handling of older and deprecated features. Each subsection
defines such a feature with configurable behavior.
@ -1869,6 +1914,7 @@ defines such a feature with configurable behavior.
## Validation
```
validation:
manifests:
urls:
@ -1876,6 +1922,7 @@ defines such a feature with configurable behavior.
- ^https?://([^/]+\.)*example\.com/
deny:
- ^https?://www\.example\.com/
```
### disabled
@ -1905,6 +1952,7 @@ one of the `allow` regular expressions and one of the following holds:
The following is a simple example you can use for local development:
```
version: 0.1
log:
level: debug
@ -1916,6 +1964,7 @@ The following is a simple example you can use for local development:
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
```
The above configures the registry instance to run on port `5000`, binding to
`localhost`, with the `debug` server enabled. Registry data storage is in the
@ -1947,7 +1996,7 @@ conjunction with the S3 storage driver.
<td>The storage middleware name. Currently <code>cloudfront</code> is an accepted value.</td>
</tr>
<tr>
<td><code>disabled<code></td>
<td><code>disabled</code></td>
<td>Set to <code>false</code> to easily disable the middleware.</td>
</tr>
<tr>
@ -1966,6 +2015,7 @@ conjunction with the S3 storage driver.
The following example illustrates these values:
```
middleware:
storage:
- name: cloudfront
@ -1975,7 +2025,7 @@ The following example illustrates these values:
privatekey: /path/to/asecret.pem
keypairid: asecret
duration: 60
```
>**Note**: Cloudfront keys exist separately to other AWS keys. See
>[the documentation on AWS credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)