docs: fix yaml sections format at docs.docker.com

yaml sections in the documentation does not display well on
docs.docker.com. This is due to the syntax highlighting
which uses highlight.js and does not support yaml
currently.
The fix is to remove triple back ticks and indent instead.
We loose yaml syntax highlighting on github, but it displays
an acceptable version on both github and docs.docker.com.

Signed-off-by: Olivier Jacques <olivier.jacques@hp.com>
This commit is contained in:
Olivier Jacques 2015-07-10 23:22:06 +02:00
parent 419bbc2da6
commit b3683863dd
2 changed files with 291 additions and 328 deletions

View file

@ -24,17 +24,13 @@ To override a configuration option, create an environment variable named
and the `_` (underscore) represents indention levels. For example, you can and the `_` (underscore) represents indention levels. For example, you can
configure the `rootdirectory` of the `filesystem` storage backend: configure the `rootdirectory` of the `filesystem` storage backend:
``` storage:
storage:
filesystem: filesystem:
rootdirectory: /var/lib/registry rootdirectory: /var/lib/registry
```
To override this value, set an environment variable like this: To override this value, set an environment variable like this:
``` REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere
```
This variable overrides the `/var/lib/registry` value to the `/somewhere` This variable overrides the `/var/lib/registry` value to the `/somewhere`
directory. directory.
@ -53,9 +49,8 @@ This section lists all the registry configuration options. Some options in
the list are mutually exclusive. So, make sure to read the detailed reference the list are mutually exclusive. So, make sure to read the detailed reference
information about each option that appears later in this page. information about each option that appears later in this page.
```yaml version: 0.1
version: 0.1 log:
log:
level: debug level: debug
formatter: text formatter: text
fields: fields:
@ -75,8 +70,8 @@ log:
from: sender@example.com from: sender@example.com
to: to:
- errors@example.com - errors@example.com
loglevel: debug # deprecated: use "log" loglevel: debug # deprecated: use "log"
storage: storage:
filesystem: filesystem:
rootdirectory: /var/lib/registry rootdirectory: /var/lib/registry
azure: azure:
@ -105,7 +100,7 @@ storage:
age: 168h age: 168h
interval: 24h interval: 24h
dryrun: false dryrun: false
auth: auth:
silly: silly:
realm: silly-realm realm: silly-realm
service: silly-service service: silly-service
@ -117,7 +112,7 @@ auth:
htpasswd: htpasswd:
realm: basic-realm realm: basic-realm
path: /path/to/htpasswd path: /path/to/htpasswd
middleware: middleware:
registry: registry:
- name: ARegistryMiddleware - name: ARegistryMiddleware
options: options:
@ -133,7 +128,7 @@ middleware:
privatekey: /path/to/pem privatekey: /path/to/pem
keypairid: cloudfrontkeypairid keypairid: cloudfrontkeypairid
duration: 3000 duration: 3000
reporting: reporting:
bugsnag: bugsnag:
apikey: bugsnagapikey apikey: bugsnagapikey
releasestage: bugsnagreleasestage releasestage: bugsnagreleasestage
@ -142,7 +137,7 @@ reporting:
licensekey: newreliclicensekey licensekey: newreliclicensekey
name: newrelicname name: newrelicname
verbose: true verbose: true
http: http:
addr: localhost:5000 addr: localhost:5000
prefix: /my/nested/registry/ prefix: /my/nested/registry/
secret: asecretforlocaldevelopment secret: asecretforlocaldevelopment
@ -154,7 +149,7 @@ http:
- /path/to/another/ca.pem - /path/to/another/ca.pem
debug: debug:
addr: localhost:5001 addr: localhost:5001
notifications: notifications:
endpoints: endpoints:
- name: alistener - name: alistener
disabled: false disabled: false
@ -163,7 +158,7 @@ notifications:
timeout: 500 timeout: 500
threshold: 5 threshold: 5
backoff: 1000 backoff: 1000
redis: redis:
addr: localhost:6379 addr: localhost:6379
password: asecret password: asecret
db: 0 db: 0
@ -174,7 +169,6 @@ redis:
maxidle: 16 maxidle: 16
maxactive: 64 maxactive: 64
idletimeout: 300s idletimeout: 300s
```
In some instances a configuration option is **optional** but it contains child 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 options marked as **required**. This indicates that you can omit the parent with
@ -185,9 +179,7 @@ the children marked **required**.
## version ## version
```yaml version: 0.1
version: 0.1
```
The `version` option is **required**. It specifies the configuration's version. 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 It is expected to remain a top-level field, to allow for a consistent version
@ -199,14 +191,12 @@ The `log` subsection configures the behavior of the logging system. The logging
system outputs everything to stdout. You can adjust the granularity and format system outputs everything to stdout. You can adjust the granularity and format
with this configuration section. with this configuration section.
```yaml log:
log:
level: debug level: debug
formatter: text formatter: text
fields: fields:
service: registry service: registry
environment: staging environment: staging
```
<table> <table>
<tr> <tr>
@ -256,9 +246,7 @@ log:
## hooks ## hooks
hooks:
```yaml
hooks:
- type: mail - type: mail
levels: levels:
- panic - panic
@ -271,7 +259,6 @@ hooks:
from: name@sendhost.com from: name@sendhost.com
to: to:
- name@receivehost.com - name@receivehost.com
```
The `hooks` subsection configures the logging hooks' behavior. This subsection The `hooks` subsection configures the logging hooks' behavior. This subsection
includes a sequence handler which you can use for sending mail, for example. includes a sequence handler which you can use for sending mail, for example.
@ -281,17 +268,14 @@ Refer to `loglevel` to configure the level of messages printed.
> **DEPRECATED:** Please use [log](#logs) instead. > **DEPRECATED:** Please use [log](#logs) instead.
```yaml loglevel: debug
loglevel: debug
```
Permitted values are `error`, `warn`, `info` and `debug`. The default is Permitted values are `error`, `warn`, `info` and `debug`. The default is
`info`. `info`.
## storage ## storage
```yaml storage:
storage:
filesystem: filesystem:
rootdirectory: /var/lib/registry rootdirectory: /var/lib/registry
azure: azure:
@ -320,7 +304,6 @@ storage:
age: 168h age: 168h
interval: 24h interval: 24h
dryrun: false dryrun: false
```
The storage option is **required** and defines which storage backend is in use. 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 must configure one backend; if you configure more, the registry returns an error.
@ -599,8 +582,7 @@ Note: `age` and `interval` are strings containing a number with optional fractio
## auth ## auth
```yaml auth:
auth:
silly: silly:
realm: silly-realm realm: silly-realm
service: silly-service service: silly-service
@ -612,7 +594,6 @@ auth:
htpasswd: htpasswd:
realm: basic-realm realm: basic-realm
path: /path/to/htpasswd path: /path/to/htpasswd
```
The `auth` option is **optional**. There are The `auth` option is **optional**. There are
currently 2 possible auth providers, `silly` and `token`. You can configure only currently 2 possible auth providers, `silly` and `token`. You can configure only
@ -777,8 +758,7 @@ object they're wrapping. This means a registry middleware must implement the
Currently only one middleware, `cloudfront`, a storage middleware, is supported Currently only one middleware, `cloudfront`, a storage middleware, is supported
in the registry implementation. in the registry implementation.
```yaml middleware:
middleware:
registry: registry:
- name: ARegistryMiddleware - name: ARegistryMiddleware
options: options:
@ -794,7 +774,6 @@ middleware:
privatekey: /path/to/pem privatekey: /path/to/pem
keypairid: cloudfrontkeypairid keypairid: cloudfrontkeypairid
duration: 3000 duration: 3000
```
Each middleware entry has `name` and `options` entries. The `name` must Each middleware entry has `name` and `options` entries. The `name` must
correspond to the name under which the middleware registers itself. The correspond to the name under which the middleware registers itself. The
@ -861,8 +840,7 @@ interpretation of the options.
## reporting ## reporting
```yaml reporting:
reporting:
bugsnag: bugsnag:
apikey: bugsnagapikey apikey: bugsnagapikey
releasestage: bugsnagreleasestage releasestage: bugsnagreleasestage
@ -871,7 +849,6 @@ reporting:
licensekey: newreliclicensekey licensekey: newreliclicensekey
name: newrelicname name: newrelicname
verbose: true verbose: true
```
The `reporting` option is **optional** and configures error and metrics The `reporting` option is **optional** and configures error and metrics
reporting tools. At the moment only two services are supported, [New reporting tools. At the moment only two services are supported, [New
@ -969,8 +946,7 @@ configuration may contain both.
## http ## http
```yaml http:
http:
addr: localhost:5000 addr: localhost:5000
net: tcp net: tcp
prefix: /my/nested/registry/ prefix: /my/nested/registry/
@ -983,7 +959,6 @@ http:
- /path/to/another/ca.pem - /path/to/another/ca.pem
debug: debug:
addr: localhost:5001 addr: localhost:5001
```
The `http` option details the configuration for the HTTP server that hosts the registry. The `http` option details the configuration for the HTTP server that hosts the registry.
@ -1109,8 +1084,7 @@ specifies the `HOST:PORT` on which the debug server should accept connections.
## notifications ## notifications
```yaml notifications:
notifications:
endpoints: endpoints:
- name: alistener - name: alistener
disabled: false disabled: false
@ -1119,7 +1093,6 @@ notifications:
timeout: 500 timeout: 500
threshold: 5 threshold: 5
backoff: 1000 backoff: 1000
```
The notifications option is **optional** and currently may contain a single The notifications option is **optional** and currently may contain a single
option, `endpoints`. option, `endpoints`.
@ -1237,8 +1210,7 @@ The URL to which events should be published.
## redis ## redis
```yaml redis:
redis:
addr: localhost:6379 addr: localhost:6379
password: asecret password: asecret
db: 0 db: 0
@ -1249,7 +1221,6 @@ redis:
maxidle: 16 maxidle: 16
maxactive: 64 maxactive: 64
idletimeout: 300s idletimeout: 300s
```
Declare parameters for constructing the redis connections. Registry instances Declare parameters for constructing the redis connections. Registry instances
may use the Redis instance for several applications. The current purpose is may use the Redis instance for several applications. The current purpose is
@ -1334,12 +1305,10 @@ with the [pool](#pool) subsection.
### pool ### pool
```yaml pool:
pool:
maxidle: 16 maxidle: 16
maxactive: 64 maxactive: 64
idletimeout: 300s idletimeout: 300s
```
Configure the behavior of the Redis connection pool. Configure the behavior of the Redis connection pool.
@ -1391,19 +1360,17 @@ Configure the behavior of the Redis connection pool.
The following is a simple example you can use for local development: The following is a simple example you can use for local development:
```yaml version: 0.1
version: 0.1 log:
log:
level: debug level: debug
storage: storage:
filesystem: filesystem:
rootdirectory: /var/lib/registry rootdirectory: /var/lib/registry
http: http:
addr: localhost:5000 addr: localhost:5000
secret: asecretforlocaldevelopment secret: asecretforlocaldevelopment
debug: debug:
addr: localhost:5001 addr: localhost:5001
```
The above configures the registry instance to run on port `5000`, binding to 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 `localhost`, with the `debug` server enabled. Registry data storage is in the
@ -1454,8 +1421,7 @@ conjunction with the S3 storage driver.
The following example illustrates these values: The following example illustrates these values:
``` middleware:
middleware:
storage: storage:
- name: cloudfront - name: cloudfront
disabled: false disabled: false
@ -1464,7 +1430,6 @@ middleware:
privatekey: /path/to/asecret.pem privatekey: /path/to/asecret.pem
keypairid: asecret keypairid: asecret
duration: 60 duration: 60
```
>**Note**: Cloudfront keys exist separately to other AWS keys. See >**Note**: Cloudfront keys exist separately to other AWS keys. See

View file

@ -36,8 +36,7 @@ order is not guaranteed.
To setup a registry instance to send notifications to endpoints, one must add To setup a registry instance to send notifications to endpoints, one must add
them to the configuration. A simple example follows: them to the configuration. A simple example follows:
```yaml notifications:
notifications:
endpoints: endpoints:
- name: alistener - name: alistener
url: https://mylistener.example.com/event url: https://mylistener.example.com/event
@ -46,7 +45,6 @@ notifications:
timeout: 500ms timeout: 500ms
threshold: 5 threshold: 5
backoff: 1s backoff: 1s
```
The above would configure the registry with an endpoint to send events to The above would configure the registry with an endpoint to send events to
`https://mylistener.example.com/event`, with the header "Authorization: Bearer `https://mylistener.example.com/event`, with the header "Authorization: Bearer