github.com/npaton/distribution@v2.3.1-rc.0+incompatible/docs/configuration.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Configuring a registry"
     4  description = "Explains how to configure a registry"
     5  keywords = ["registry, on-prem, images, tags, repository, distribution, configuration"]
     6  [menu.main]
     7  parent="smn_registry"
     8  weight=4
     9  +++
    10  <![end-metadata]-->
    11  
    12  # Registry Configuration Reference
    13  
    14  The Registry configuration is based on a YAML file, detailed below. While it comes with sane default values out of the box, you are heavily encouraged to review it exhaustively before moving your systems to production.
    15  
    16  ## Override specific configuration options
    17  
    18  In a typical setup where you run your Registry from the official image, you can specify a configuration variable from the environment by passing `-e` arguments to your `docker run` stanza, or from within a Dockerfile using the `ENV` instruction.
    19  
    20  To override a configuration option, create an environment variable named
    21  `REGISTRY_variable` where *`variable`* is the name of the configuration option
    22  and the `_` (underscore) represents indention levels. For example, you can
    23  configure the `rootdirectory` of the `filesystem` storage backend:
    24  
    25      storage:
    26        filesystem:
    27          rootdirectory: /var/lib/registry
    28  
    29  To override this value, set an environment variable like this:
    30  
    31      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere
    32  
    33  This variable overrides the `/var/lib/registry` value to the `/somewhere`
    34  directory.
    35  
    36  >**NOTE**: It is highly recommended to create a base configuration file with which environment variables can be used to tweak individual values.  Overriding configuration sections with environment variables is not recommended.
    37  
    38  ## Overriding the entire configuration file
    39  
    40  If the default configuration is not a sound basis for your usage, or if you are having issues overriding keys from the environment, you can specify an alternate YAML configuration file by mounting it as a volume in the container.
    41  
    42  Typically, create a new configuration file from scratch, and call it `config.yml`, then:
    43  
    44      docker run -d -p 5000:5000 --restart=always --name registry \
    45        -v `pwd`/config.yml:/etc/docker/registry/config.yml \
    46        registry:2
    47  
    48  You can (and probably should) use [this as a starting point](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml).
    49  
    50  ## List of configuration options
    51  
    52  This section lists all the registry configuration options. Some options in
    53  the list are mutually exclusive. So, make sure to read the detailed reference
    54  information about each option that appears later in this page.
    55  
    56      version: 0.1
    57      log:
    58        level: debug
    59        formatter: text
    60        fields:
    61          service: registry
    62          environment: staging
    63        hooks:
    64          - type: mail
    65            disabled: true
    66            levels:
    67              - panic
    68            options:
    69              smtp:
    70                addr: mail.example.com:25
    71                username: mailuser
    72                password: password
    73                insecure: true
    74              from: sender@example.com
    75              to:
    76                - errors@example.com
    77      loglevel: debug # deprecated: use "log"
    78      storage:
    79        filesystem:
    80          rootdirectory: /var/lib/registry
    81        azure:
    82          accountname: accountname
    83          accountkey: base64encodedaccountkey
    84          container: containername
    85        gcs:
    86          bucket: bucketname
    87          keyfile: /path/to/keyfile
    88          rootdirectory: /gcs/object/name/prefix
    89        s3:
    90          accesskey: awsaccesskey
    91          secretkey: awssecretkey
    92          region: us-west-1
    93          bucket: bucketname
    94          encrypt: true
    95          secure: true
    96          v4auth: true
    97          chunksize: 5242880
    98          rootdirectory: /s3/object/name/prefix
    99        rados:
   100          poolname: radospool
   101          username: radosuser
   102          chunksize: 4194304
   103        swift:
   104          username: username
   105          password: password
   106          authurl: https://storage.myprovider.com/auth/v1.0 or https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth
   107          tenant: tenantname
   108          tenantid: tenantid
   109          domain: domain name for Openstack Identity v3 API
   110          domainid: domain id for Openstack Identity v3 API
   111          insecureskipverify: true
   112          region: fr
   113          container: containername
   114          rootdirectory: /swift/object/name/prefix
   115        oss:
   116          accesskeyid: accesskeyid
   117          accesskeysecret: accesskeysecret
   118          region: OSS region name
   119          endpoint: optional endpoints
   120          internal: optional internal endpoint
   121          bucket: OSS bucket
   122          encrypt: optional data encryption setting
   123          secure: optional ssl setting
   124          chunksize: optional size valye
   125          rootdirectory: optional root directory
   126        inmemory:  # This driver takes no parameters
   127        delete:
   128          enabled: false
   129        redirect:
   130          disable: false
   131        cache:
   132          blobdescriptor: redis
   133        maintenance:
   134          uploadpurging:
   135            enabled: true
   136            age: 168h
   137            interval: 24h
   138            dryrun: false
   139          readonly:
   140            enabled: false
   141      auth:
   142        silly:
   143          realm: silly-realm
   144          service: silly-service
   145        token:
   146          realm: token-realm
   147          service: token-service
   148          issuer: registry-token-issuer
   149          rootcertbundle: /root/certs/bundle
   150        htpasswd:
   151          realm: basic-realm
   152          path: /path/to/htpasswd
   153      middleware:
   154        registry:
   155          - name: ARegistryMiddleware
   156            options:
   157              foo: bar
   158        repository:
   159          - name: ARepositoryMiddleware
   160            options:
   161              foo: bar
   162        storage:
   163          - name: cloudfront
   164            options:
   165              baseurl: https://my.cloudfronted.domain.com/
   166              privatekey: /path/to/pem
   167              keypairid: cloudfrontkeypairid
   168              duration: 3000
   169      reporting:
   170        bugsnag:
   171          apikey: bugsnagapikey
   172          releasestage: bugsnagreleasestage
   173          endpoint: bugsnagendpoint
   174        newrelic:
   175          licensekey: newreliclicensekey
   176          name: newrelicname
   177          verbose: true
   178      http:
   179        addr: localhost:5000
   180        prefix: /my/nested/registry/
   181        host: https://myregistryaddress.org:5000
   182        secret: asecretforlocaldevelopment
   183        tls:
   184          certificate: /path/to/x509/public
   185          key: /path/to/x509/private
   186          clientcas:
   187            - /path/to/ca.pem
   188            - /path/to/another/ca.pem
   189        debug:
   190          addr: localhost:5001
   191        headers:
   192          X-Content-Type-Options: [nosniff]
   193      notifications:
   194        endpoints:
   195          - name: alistener
   196            disabled: false
   197            url: https://my.listener.com/event
   198            headers: <http.Header>
   199            timeout: 500
   200            threshold: 5
   201            backoff: 1000
   202      redis:
   203        addr: localhost:6379
   204        password: asecret
   205        db: 0
   206        dialtimeout: 10ms
   207        readtimeout: 10ms
   208        writetimeout: 10ms
   209        pool:
   210          maxidle: 16
   211          maxactive: 64
   212          idletimeout: 300s
   213      health:
   214        storagedriver:
   215          enabled: true
   216          interval: 10s
   217          threshold: 3
   218        file:
   219          - file: /path/to/checked/file
   220            interval: 10s
   221        http:
   222          - uri: http://server.to.check/must/return/200
   223            headers:
   224              Authorization: [Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==]
   225            statuscode: 200
   226            timeout: 3s
   227            interval: 10s
   228            threshold: 3
   229        tcp:
   230          - addr: redis-server.domain.com:6379
   231            timeout: 3s
   232            interval: 10s
   233            threshold: 3
   234      proxy:
   235        remoteurl: https://registry-1.docker.io
   236        username: [username]
   237        password: [password]
   238  
   239  In some instances a configuration option is **optional** but it contains child
   240  options marked as **required**. This indicates that you can omit the parent with
   241  all its children. However, if the parent is included, you must also include all
   242  the children marked **required**.
   243  
   244  ## version
   245  
   246      version: 0.1
   247  
   248  The `version` option is **required**. It specifies the configuration's version.
   249  It is expected to remain a top-level field, to allow for a consistent version
   250  check before parsing the remainder of the configuration file.
   251  
   252  ## log
   253  
   254  The `log` subsection configures the behavior of the logging system. The logging
   255  system outputs everything to stdout. You can adjust the granularity and format
   256  with this configuration section.
   257  
   258      log:
   259        level: debug
   260        formatter: text
   261        fields:
   262          service: registry
   263          environment: staging
   264  
   265  <table>
   266    <tr>
   267      <th>Parameter</th>
   268      <th>Required</th>
   269      <th>Description</th>
   270    </tr>
   271    <tr>
   272      <td>
   273        <code>level</code>
   274      </td>
   275      <td>
   276        no
   277      </td>
   278      <td>
   279        Sets the sensitivity of logging output. Permitted values are
   280        <code>error</code>, <code>warn</code>, <code>info</code> and
   281        <code>debug</code>. The default is <code>info</code>.
   282      </td>
   283    </tr>
   284    <tr>
   285      <td>
   286        <code>formatter</code>
   287      </td>
   288      <td>
   289        no
   290      </td>
   291      <td>
   292        This selects the format of logging output. The format primarily affects how keyed
   293        attributes for a log line are encoded. Options are <code>text</code>, <code>json</code> or
   294        <code>logstash</code>. The default is <code>text</code>.
   295      </td>
   296    </tr>
   297      <tr>
   298      <td>
   299        <code>fields</code>
   300      </td>
   301      <td>
   302        no
   303      </td>
   304      <td>
   305        A map of field names to values. These are added to every log line for
   306        the context. This is useful for identifying log messages source after
   307        being mixed in other systems.
   308      </td>
   309  </table>
   310  
   311  ## hooks
   312  
   313      hooks:
   314        - type: mail
   315          levels:
   316            - panic
   317          options:
   318            smtp:
   319              addr: smtp.sendhost.com:25
   320              username: sendername
   321              password: password
   322              insecure: true
   323            from: name@sendhost.com
   324            to:
   325              - name@receivehost.com
   326  
   327  The `hooks` subsection configures the logging hooks' behavior. This subsection
   328  includes a sequence handler which you can use for sending mail, for example.
   329  Refer to `loglevel` to configure the level of messages printed.
   330  
   331  ## loglevel
   332  
   333  > **DEPRECATED:** Please use [log](#log) instead.
   334  
   335      loglevel: debug
   336  
   337  Permitted values are `error`, `warn`, `info` and `debug`. The default is
   338  `info`.
   339  
   340  ## storage
   341  
   342      storage:
   343        filesystem:
   344          rootdirectory: /var/lib/registry
   345        azure:
   346          accountname: accountname
   347          accountkey: base64encodedaccountkey
   348          container: containername
   349        gcs:
   350          bucket: bucketname
   351          keyfile: /path/to/keyfile
   352          rootdirectory: /gcs/object/name/prefix
   353        s3:
   354          accesskey: awsaccesskey
   355          secretkey: awssecretkey
   356          region: us-west-1
   357          bucket: bucketname
   358          encrypt: true
   359          secure: true
   360          v4auth: true
   361          chunksize: 5242880
   362          rootdirectory: /s3/object/name/prefix
   363        rados:
   364          poolname: radospool
   365          username: radosuser
   366          chunksize: 4194304
   367        swift:
   368          username: username
   369          password: password
   370          authurl: https://storage.myprovider.com/auth/v1.0 or https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth
   371          tenant: tenantname
   372          tenantid: tenantid
   373          domain: domain name for Openstack Identity v3 API
   374          domainid: domain id for Openstack Identity v3 API
   375          insecureskipverify: true
   376          region: fr
   377          container: containername
   378          rootdirectory: /swift/object/name/prefix
   379        oss:
   380          accesskeyid: accesskeyid
   381          accesskeysecret: accesskeysecret
   382          region: OSS region name
   383          endpoint: optional endpoints
   384          internal: optional internal endpoint
   385          bucket: OSS bucket
   386          encrypt: optional data encryption setting
   387          secure: optional ssl setting
   388          chunksize: optional size valye
   389          rootdirectory: optional root directory
   390        inmemory:
   391        delete:
   392          enabled: false
   393        cache:
   394          blobdescriptor: inmemory
   395        maintenance:
   396          uploadpurging:
   397            enabled: true
   398            age: 168h
   399            interval: 24h
   400            dryrun: false
   401        redirect:
   402          disable: false
   403  
   404  The storage option is **required** and defines which storage backend is in use.
   405  You must configure one backend; if you configure more, the registry returns an error. You can choose any of these backend storage drivers:
   406  
   407  <table>
   408    <tr>
   409      <td><code>filesystem</code></td>
   410      <td>Uses the local disk to store registry files. It is ideal for development and may be appropriate for some small-scale production applications.
   411      See the <a href="../storage-drivers/filesystem/">driver's reference documentation</a>.
   412      </td>
   413    </tr>
   414    <tr>
   415      <td><code>azure</code></td>
   416      <td>Uses Microsoft's Azure Blob Storage.
   417      See the <a href="../storage-drivers/azure/">driver's reference documentation</a>.
   418      </td>
   419    </tr>
   420    <tr>
   421      <td><code>gcs</code></td>
   422      <td>Uses Google Cloud Storage.
   423      See the <a href="../storage-drivers/gcs/">driver's reference documentation</a>.
   424      </td>
   425    </tr>
   426    <tr>
   427      <td><code>rados</code></td>
   428      <td>Uses Ceph Object Storage.
   429      See the <a href="../storage-drivers/rados/">driver's reference documentation</a>.
   430      </td>
   431    </tr>
   432    <tr>
   433      <td><code>s3</code></td>
   434      <td>Uses Amazon's Simple Storage Service (S3).
   435      See the <a href="../storage-drivers/s3/">driver's reference documentation</a>.
   436      </td>
   437    </tr>
   438    <tr>
   439      <td><code>swift</code></td>
   440      <td>Uses Openstack Swift object storage.
   441      See the <a href="../storage-drivers/swift/">driver's reference documentation</a>.
   442      </td>
   443    </tr>
   444    <tr>
   445      <td><code>oss</code></td>
   446      <td>Uses Aliyun OSS for object storage.
   447      See the <a href="../storage-drivers/oss/">driver's reference documentation</a>.
   448      </td>
   449    </tr>
   450  </table>
   451  
   452  For purely tests purposes, you can use the [`inmemory` storage
   453  driver](storage-drivers/inmemory.md). If you would like to run a registry from
   454  volatile memory, use the [`filesystem` driver](storage-drivers/filesystem.md) on
   455  a ramdisk.
   456  
   457  If you are deploying a registry on Windows, be aware that a Windows volume
   458  mounted from the host is not recommended. Instead, you can use a S3, or Azure,
   459  backing data-store. If you do use a Windows volume, you must ensure that the
   460  `PATH` to the mount point is within Windows' `MAX_PATH` limits (typically 255
   461  characters). Failure to do so can result in the following error message:
   462  
   463      mkdir /XXX protocol error and your registry will not function properly.
   464  
   465  ### Maintenance
   466  
   467  Currently upload purging and read-only mode are the only maintenance functions available.
   468  These and future maintenance functions which are related to storage can be configured under
   469  the maintenance section.
   470  
   471  ### Upload Purging
   472  
   473  Upload purging is a background process that periodically removes orphaned files from the upload
   474  directories of the registry.  Upload purging is enabled by default.  To
   475  configure upload directory purging, the following parameters
   476  must be set.
   477  
   478  
   479  | Parameter | Required | Description
   480    --------- | -------- | -----------
   481  `enabled` | yes | Set to true to enable upload purging.  Default=true. |
   482  `age` | yes | Upload directories which are older than this age will be deleted.  Default=168h (1 week)
   483  `interval` | yes | The interval between upload directory purging.  Default=24h.
   484  `dryrun` | yes |  dryrun can be set to true to obtain a summary of what directories will be deleted.  Default=false.
   485  
   486  Note: `age` and `interval` are strings containing a number with optional fraction and a unit suffix: e.g. 45m, 2h10m, 168h (1 week).
   487  
   488  ### Read-only mode
   489  
   490  If the `readonly` section under `maintenance` has `enabled` set to `true`,
   491  clients will not be allowed to write to the registry. This mode is useful to
   492  temporarily prevent writes to the backend storage so a garbage collection pass
   493  can be run.  Before running garbage collection, the registry should be
   494  restarted with readonly's `enabled` set to true. After the garbage collection
   495  pass finishes, the registry may be restarted again, this time with `readonly`
   496  removed from the configuration (or set to false).
   497  
   498  ### delete
   499  
   500  Use the `delete` subsection to enable the deletion of image blobs and manifests
   501  by digest. It defaults to false, but it can be enabled by writing the following
   502  on the configuration file:
   503  
   504      delete:
   505        enabled: true
   506  
   507  ### cache
   508  
   509  Use the `cache` subsection to enable caching of data accessed in the storage
   510  backend. Currently, the only available cache provides fast access to layer
   511  metadata. This, if configured, uses the `blobdescriptor` field.
   512  
   513  You can set `blobdescriptor` field to `redis` or `inmemory`.  The `redis` value uses
   514  a Redis pool to cache layer metadata.  The `inmemory` value uses an in memory
   515  map.
   516  
   517  >**NOTE**: Formerly, `blobdescriptor` was known as `layerinfo`. While these
   518  >are equivalent, `layerinfo` has been deprecated, in favor or
   519  >`blobdescriptor`.
   520  
   521  ### redirect
   522  
   523  The `redirect` subsection provides configuration for managing redirects from
   524  content backends. For backends that support it, redirecting is enabled by
   525  default. Certain deployment scenarios may prefer to route all data through the
   526  Registry, rather than redirecting to the backend. This may be more efficient
   527  when using a backend that is not co-located or when a registry instance is
   528  doing aggressive caching.
   529  
   530  Redirects can be disabled by adding a single flag `disable`, set to `true`
   531  under the `redirect` section:
   532  
   533      redirect:
   534        disable: true
   535  
   536  
   537  ## auth
   538  
   539      auth:
   540        silly:
   541          realm: silly-realm
   542          service: silly-service
   543        token:
   544          realm: token-realm
   545          service: token-service
   546          issuer: registry-token-issuer
   547          rootcertbundle: /root/certs/bundle
   548        htpasswd:
   549          realm: basic-realm
   550          path: /path/to/htpasswd
   551  
   552  The `auth` option is **optional**. There are
   553  currently 3 possible auth providers, `silly`, `token` and `htpasswd`. You can configure only
   554  one `auth` provider.
   555  
   556  ### silly
   557  
   558  The `silly` auth is only for development purposes. It simply checks for the
   559  existence of the `Authorization` header in the HTTP request. It has no regard for
   560  the header's value. If the header does not exist, the `silly` auth responds with a
   561  challenge response, echoing back the realm, service, and scope that access was
   562  denied for.
   563  
   564  The following values are used to configure the response:
   565  
   566  <table>
   567    <tr>
   568      <th>Parameter</th>
   569      <th>Required</th>
   570      <th>Description</th>
   571    </tr>
   572    <tr>
   573      <td>
   574        <code>realm</code>
   575      </td>
   576      <td>
   577        yes
   578      </td>
   579      <td>
   580        The realm in which the registry server authenticates.
   581      </td>
   582    </tr>
   583      <tr>
   584      <td>
   585        <code>service</code>
   586      </td>
   587      <td>
   588        yes
   589      </td>
   590      <td>
   591        The service being authenticated.
   592      </td>
   593    </tr>
   594  </table>
   595  
   596  
   597  
   598  ### token
   599  
   600  Token based authentication allows the authentication system to be decoupled from
   601  the registry. It is a well established authentication paradigm with a high
   602  degree of security.
   603  
   604  <table>
   605    <tr>
   606      <th>Parameter</th>
   607      <th>Required</th>
   608      <th>Description</th>
   609    </tr>
   610    <tr>
   611      <td>
   612        <code>realm</code>
   613      </td>
   614      <td>
   615        yes
   616      </td>
   617      <td>
   618        The realm in which the registry server authenticates.
   619      </td>
   620    </tr>
   621      <tr>
   622      <td>
   623        <code>service</code>
   624      </td>
   625      <td>
   626        yes
   627      </td>
   628      <td>
   629        The service being authenticated.
   630      </td>
   631    </tr>
   632      <tr>
   633      <td>
   634        <code>issuer</code>
   635      </td>
   636      <td>
   637        yes
   638      </td>
   639      <td>
   640  The name of the token issuer. The issuer inserts this into
   641  the token so it must match the value configured for the issuer.
   642      </td>
   643    </tr>
   644      <tr>
   645      <td>
   646        <code>rootcertbundle</code>
   647      </td>
   648      <td>
   649        yes
   650       </td>
   651      <td>
   652  The absolute path to the root certificate bundle. This bundle contains the
   653  public part of the certificates that is used to sign authentication tokens.
   654       </td>
   655    </tr>
   656  </table>
   657  
   658  For more information about Token based authentication configuration, see the [specification](spec/auth/token.md).
   659  
   660  ### htpasswd
   661  
   662  The _htpasswd_ authentication backed allows one to configure basic auth using an
   663  [Apache htpasswd
   664  file](https://httpd.apache.org/docs/2.4/programs/htpasswd.html). Only
   665  [`bcrypt`](http://en.wikipedia.org/wiki/Bcrypt) format passwords are supported.
   666  Entries with other hash types will be ignored. The htpasswd file is loaded once,
   667  at startup. If the file is invalid, the registry will display an error and will
   668  not start.
   669  
   670  > __WARNING:__ This authentication scheme should only be used with TLS
   671  > configured, since basic authentication sends passwords as part of the http
   672  > header.
   673  
   674  <table>
   675    <tr>
   676      <th>Parameter</th>
   677      <th>Required</th>
   678      <th>Description</th>
   679    </tr>
   680    <tr>
   681      <td>
   682        <code>realm</code>
   683      </td>
   684      <td>
   685        yes
   686      </td>
   687      <td>
   688        The realm in which the registry server authenticates.
   689      </td>
   690    </tr>
   691      <tr>
   692      <td>
   693        <code>path</code>
   694      </td>
   695      <td>
   696        yes
   697      </td>
   698      <td>
   699        Path to htpasswd file to load at startup.
   700      </td>
   701    </tr>
   702  </table>
   703  
   704  ## middleware
   705  
   706  The `middleware` option is **optional**. Use this option to inject middleware at
   707  named hook points. All middleware must implement the same interface as the
   708  object they're wrapping. This means a registry middleware must implement the
   709  `distribution.Namespace` interface, repository middleware must implement
   710  `distribution.Repository`, and storage middleware must implement
   711  `driver.StorageDriver`.
   712  
   713  Currently only one middleware, `cloudfront`, a storage middleware, is supported
   714  in the registry implementation.
   715  
   716      middleware:
   717        registry:
   718          - name: ARegistryMiddleware
   719            options:
   720              foo: bar
   721        repository:
   722          - name: ARepositoryMiddleware
   723            options:
   724              foo: bar
   725        storage:
   726          - name: cloudfront
   727            options:
   728              baseurl: https://my.cloudfronted.domain.com/
   729              privatekey: /path/to/pem
   730              keypairid: cloudfrontkeypairid
   731              duration: 3000
   732  
   733  Each middleware entry has `name` and `options` entries. The `name` must
   734  correspond to the name under which the middleware registers itself. The
   735  `options` field is a map that details custom configuration required to
   736  initialize the middleware. It is treated as a `map[string]interface{}`. As such,
   737  it supports any interesting structures desired, leaving it up to the middleware
   738  initialization function to best determine how to handle the specific
   739  interpretation of the options.
   740  
   741  ### cloudfront
   742  
   743  <table>
   744    <tr>
   745      <th>Parameter</th>
   746      <th>Required</th>
   747      <th>Description</th>
   748    </tr>
   749    <tr>
   750      <td>
   751        <code>baseurl</code>
   752      </td>
   753      <td>
   754        yes
   755      </td>
   756      <td>
   757        <code>SCHEME://HOST[/PATH]</code> at which Cloudfront is served.
   758      </td>
   759    </tr>
   760      <tr>
   761      <td>
   762        <code>privatekey</code>
   763      </td>
   764      <td>
   765        yes
   766      </td>
   767      <td>
   768        Private Key for Cloudfront provided by AWS.
   769      </td>
   770    </tr>
   771      <tr>
   772      <td>
   773        <code>keypairid</code>
   774      </td>
   775      <td>
   776        yes
   777      </td>
   778      <td>
   779        Key pair ID provided by AWS.
   780      </td>
   781    </tr>
   782      <tr>
   783      <td>
   784        <code>duration</code>
   785      </td>
   786      <td>
   787        no
   788      </td>
   789      <td>
   790        Duration for which a signed URL should be valid.
   791      </td>
   792    </tr>
   793  </table>
   794  
   795  
   796  ## reporting
   797  
   798      reporting:
   799        bugsnag:
   800          apikey: bugsnagapikey
   801          releasestage: bugsnagreleasestage
   802          endpoint: bugsnagendpoint
   803        newrelic:
   804          licensekey: newreliclicensekey
   805          name: newrelicname
   806          verbose: true
   807  
   808  The `reporting` option is **optional** and configures error and metrics
   809  reporting tools. At the moment only two services are supported, [New
   810  Relic](http://newrelic.com/) and [Bugsnag](http://bugsnag.com), a valid
   811  configuration may contain both.
   812  
   813  ### bugsnag
   814  
   815  <table>
   816    <tr>
   817      <th>Parameter</th>
   818      <th>Required</th>
   819      <th>Description</th>
   820    </tr>
   821    <tr>
   822      <td>
   823        <code>apikey</code>
   824      </td>
   825      <td>
   826        yes
   827      </td>
   828      <td>
   829        API Key provided by Bugsnag
   830      </td>
   831    </tr>
   832    <tr>
   833      <td>
   834        <code>releasestage</code>
   835      </td>
   836      <td>
   837        no
   838      </td>
   839      <td>
   840        Tracks where the registry is deployed, for example,
   841        <code>production</code>,<code>staging</code>, or
   842        <code>development</code>.
   843      </td>
   844    </tr>
   845    <tr>
   846      <td>
   847        <code>endpoint</code>
   848      </td>
   849      <td>
   850        no
   851      </td>
   852      <td>
   853        Specify the enterprise Bugsnag endpoint.
   854      </td>
   855    </tr>
   856  </table>
   857  
   858  
   859  ### newrelic
   860  
   861  <table>
   862    <tr>
   863      <th>Parameter</th>
   864      <th>Required</th>
   865      <th>Description</th>
   866    </tr>
   867    <tr>
   868      <td>
   869        <code>licensekey</code>
   870      </td>
   871      <td>
   872        yes
   873      </td>
   874      <td>
   875        License key provided by New Relic.
   876      </td>
   877    </tr>
   878     <tr>
   879      <td>
   880        <code>name</code>
   881      </td>
   882      <td>
   883        no
   884      </td>
   885      <td>
   886        New Relic application name.
   887      </td>
   888    </tr>
   889       <tr>
   890      <td>
   891        <code>verbose</code>
   892      </td>
   893      <td>
   894        no
   895      </td>
   896      <td>
   897        Enable New Relic debugging output on stdout.
   898      </td>
   899    </tr>
   900  </table>
   901  
   902  ## http
   903  
   904      http:
   905        addr: localhost:5000
   906        net: tcp
   907        prefix: /my/nested/registry/
   908        host: https://myregistryaddress.org:5000
   909        secret: asecretforlocaldevelopment
   910        tls:
   911          certificate: /path/to/x509/public
   912          key: /path/to/x509/private
   913          clientcas:
   914            - /path/to/ca.pem
   915            - /path/to/another/ca.pem
   916        debug:
   917          addr: localhost:5001
   918        headers:
   919          X-Content-Type-Options: [nosniff]
   920  
   921  The `http` option details the configuration for the HTTP server that hosts the registry.
   922  
   923  <table>
   924    <tr>
   925      <th>Parameter</th>
   926      <th>Required</th>
   927      <th>Description</th>
   928    </tr>
   929    <tr>
   930      <td>
   931        <code>addr</code>
   932      </td>
   933      <td>
   934        yes
   935      </td>
   936      <td>
   937       The address for which the server should accept connections. The form depends on a network type (see <code>net</code> option):
   938       <code>HOST:PORT</code> for tcp and <code>FILE</code> for a unix socket.
   939      </td>
   940    </tr>
   941    <tr>
   942      <td>
   943        <code>net</code>
   944      </td>
   945      <td>
   946        no
   947      </td>
   948      <td>
   949       The network which is used to create a listening socket. Known networks are <code>unix</code> and <code>tcp</code>.
   950       The default empty value means tcp.
   951      </td>
   952    </tr>
   953    <tr>
   954      <td>
   955        <code>prefix</code>
   956      </td>
   957      <td>
   958        no
   959      </td>
   960      <td>
   961  If the server does not run at the root path use this value to specify the
   962  prefix. The root path is the section before <code>v2</code>. It
   963  should have both preceding and trailing slashes, for example <code>/path/</code>.
   964      </td>
   965    </tr>
   966    <tr>
   967      <td>
   968        <code>host</code>
   969      </td>
   970      <td>
   971        no
   972      </td>
   973      <td>
   974  This parameter specifies an externally-reachable address for the registry, as a
   975  fully qualified URL. If present, it is used when creating generated URLs.
   976  Otherwise, these URLs are derived from client requests.
   977      </td>
   978    </tr>
   979    <tr>
   980      <td>
   981        <code>secret</code>
   982      </td>
   983      <td>
   984        yes
   985      </td>
   986      <td>
   987  A random piece of data. This is used to sign state that may be stored with the
   988  client to protect against tampering. For production environments you should generate a
   989  random piece of data using a cryptographically secure random generator. This
   990  configuration parameter may be omitted, in which case the registry will automatically
   991  generate a secret at launch.
   992  <p />
   993  <b>WARNING: If you are building a cluster of registries behind a load balancer, you MUST
   994  ensure the secret is the same for all registries.</b>
   995      </td>
   996    </tr>
   997  </table>
   998  
   999  
  1000  ### tls
  1001  
  1002  The `tls` struct within `http` is **optional**. Use this to configure TLS
  1003  for the server. If you already have a server such as Nginx or Apache running on
  1004  the same host as the registry, you may prefer to configure TLS termination there
  1005  and proxy connections to the registry server.
  1006  
  1007  <table>
  1008    <tr>
  1009      <th>Parameter</th>
  1010      <th>Required</th>
  1011      <th>Description</th>
  1012    </tr>
  1013    <tr>
  1014      <td>
  1015        <code>certificate</code>
  1016      </td>
  1017      <td>
  1018        yes
  1019      </td>
  1020      <td>
  1021         Absolute path to x509 cert file
  1022      </td>
  1023    </tr>
  1024      <tr>
  1025      <td>
  1026        <code>key</code>
  1027      </td>
  1028      <td>
  1029        yes
  1030      </td>
  1031      <td>
  1032        Absolute path to x509 private key file.
  1033      </td>
  1034    </tr>
  1035    <tr>
  1036      <td>
  1037        <code>clientcas</code>
  1038      </td>
  1039      <td>
  1040        no
  1041      </td>
  1042      <td>
  1043        An array of absolute paths to a x509 CA file
  1044      </td>
  1045    </tr>
  1046  </table>
  1047  
  1048  
  1049  ### debug
  1050  
  1051  The `debug` option is **optional** . Use it to configure a debug server that
  1052  can be helpful in diagnosing problems. The debug endpoint can be used for
  1053  monitoring registry metrics and health, as well as profiling. Sensitive
  1054  information may be available via the debug endpoint. Please be certain that
  1055  access to the debug endpoint is locked down in a production environment.
  1056  
  1057  The `debug` section takes a single, required `addr` parameter. This parameter
  1058  specifies the `HOST:PORT` on which the debug server should accept connections.
  1059  
  1060  
  1061  ### headers
  1062  
  1063  The `headers` option is **optional** . Use it to specify headers that the HTTP
  1064  server should include in responses. This can be used for security headers such
  1065  as `Strict-Transport-Security`.
  1066  
  1067  The `headers` option should contain an option for each header to include, where
  1068  the parameter name is the header's name, and the parameter value a list of the
  1069  header's payload values.
  1070  
  1071  Including `X-Content-Type-Options: [nosniff]` is recommended, so that browsers
  1072  will not interpret content as HTML if they are directed to load a page from the
  1073  registry. This header is included in the example configuration files.
  1074  
  1075  
  1076  ## notifications
  1077  
  1078      notifications:
  1079        endpoints:
  1080          - name: alistener
  1081            disabled: false
  1082            url: https://my.listener.com/event
  1083            headers: <http.Header>
  1084            timeout: 500
  1085            threshold: 5
  1086            backoff: 1000
  1087  
  1088  The notifications option is **optional** and currently may contain a single
  1089  option, `endpoints`.
  1090  
  1091  ### endpoints
  1092  
  1093  Endpoints is a list of named services (URLs) that can accept event notifications.
  1094  
  1095  <table>
  1096    <tr>
  1097      <th>Parameter</th>
  1098      <th>Required</th>
  1099      <th>Description</th>
  1100    </tr>
  1101    <tr>
  1102      <td>
  1103        <code>name</code>
  1104      </td>
  1105      <td>
  1106        yes
  1107      </td>
  1108      <td>
  1109  A human readable name for the service.
  1110  </td>
  1111    </tr>
  1112    <tr>
  1113      <td>
  1114        <code>disabled</code>
  1115      </td>
  1116      <td>
  1117        no
  1118      </td>
  1119      <td>
  1120  A boolean to enable/disable notifications for a service.
  1121      </td>
  1122    </tr>
  1123    <tr>
  1124      <td>
  1125        <code>url</code>
  1126      </td>
  1127      <td>
  1128      yes
  1129      </td>
  1130      <td>
  1131  The URL to which events should be published.
  1132      </td>
  1133    </tr>
  1134     <tr>
  1135      <td>
  1136        <code>headers</code>
  1137      </td>
  1138      <td>
  1139        yes
  1140      </td>
  1141      <td>
  1142        Static headers to add to each request. Each header's name should be a key
  1143        underneath headers, and each value is a list of payloads for that
  1144        header name. Note that values must always be lists.
  1145      </td>
  1146    </tr>
  1147    <tr>
  1148      <td>
  1149        <code>timeout</code>
  1150      </td>
  1151      <td>
  1152        yes
  1153      </td>
  1154      <td>
  1155        An HTTP timeout value. This field takes a positive integer and an optional
  1156        suffix indicating the unit of time. Possible units are:
  1157        <ul>
  1158          <li><code>ns</code> (nanoseconds)</li>
  1159          <li><code>us</code> (microseconds)</li>
  1160          <li><code>ms</code> (milliseconds)</li>
  1161          <li><code>s</code> (seconds)</li>
  1162          <li><code>m</code> (minutes)</li>
  1163          <li><code>h</code> (hours)</li>
  1164        </ul>
  1165      If you omit the suffix, the system interprets the value as nanoseconds.
  1166      </td>
  1167    </tr>
  1168    <tr>
  1169      <td>
  1170        <code>threshold</code>
  1171      </td>
  1172      <td>
  1173        yes
  1174      </td>
  1175      <td>
  1176        An integer specifying how long to wait before backing off a failure.
  1177      </td>
  1178    </tr>
  1179    <tr>
  1180      <td>
  1181        <code>backoff</code>
  1182      </td>
  1183      <td>
  1184        yes
  1185      </td>
  1186      <td>
  1187        How long the system backs off before retrying. This field takes a positive
  1188        integer and an optional suffix indicating the unit of time. Possible units
  1189        are:
  1190        <ul>
  1191          <li><code>ns</code> (nanoseconds)</li>
  1192          <li><code>us</code> (microseconds)</li>
  1193          <li><code>ms</code> (milliseconds)</li>
  1194          <li><code>s</code> (seconds)</li>
  1195          <li><code>m</code> (minutes)</li>
  1196          <li><code>h</code> (hours)</li>
  1197        </ul>
  1198      If you omit the suffix, the system interprets the value as nanoseconds.
  1199      </td>
  1200    </tr>
  1201  </table>
  1202  
  1203  
  1204  ## redis
  1205  
  1206      redis:
  1207        addr: localhost:6379
  1208        password: asecret
  1209        db: 0
  1210        dialtimeout: 10ms
  1211        readtimeout: 10ms
  1212        writetimeout: 10ms
  1213        pool:
  1214          maxidle: 16
  1215          maxactive: 64
  1216          idletimeout: 300s
  1217  
  1218  Declare parameters for constructing the redis connections. Registry instances
  1219  may use the Redis instance for several applications. The current purpose is
  1220  caching information about immutable blobs. Most of the options below control
  1221  how the registry connects to redis. You can control the pool's behavior
  1222  with the [pool](#pool) subsection.
  1223  
  1224  It's advisable to configure Redis itself with the **allkeys-lru** eviction policy
  1225  as the registry does not set an expire value on keys.
  1226  
  1227  <table>
  1228    <tr>
  1229      <th>Parameter</th>
  1230      <th>Required</th>
  1231      <th>Description</th>
  1232    </tr>
  1233    <tr>
  1234      <td>
  1235        <code>addr</code>
  1236      </td>
  1237      <td>
  1238        yes
  1239      </td>
  1240      <td>
  1241        Address (host and port) of redis instance.
  1242      </td>
  1243    </tr>
  1244    <tr>
  1245      <td>
  1246        <code>password</code>
  1247      </td>
  1248      <td>
  1249        no
  1250      </td>
  1251      <td>
  1252        A password used to authenticate to the redis instance.
  1253      </td>
  1254    </tr>
  1255    <tr>
  1256      <td>
  1257        <code>db</code>
  1258      </td>
  1259      <td>
  1260        no
  1261      </td>
  1262      <td>
  1263        Selects the db for each connection.
  1264      </td>
  1265    </tr>
  1266    <tr>
  1267      <td>
  1268        <code>dialtimeout</code>
  1269      </td>
  1270      <td>
  1271        no
  1272      </td>
  1273      <td>
  1274        Timeout for connecting to a redis instance.
  1275      </td>
  1276    </tr>
  1277    <tr>
  1278      <td>
  1279        <code>readtimeout</code>
  1280      </td>
  1281      <td>
  1282        no
  1283      </td>
  1284      <td>
  1285        Timeout for reading from redis connections.
  1286      </td>
  1287    </tr>
  1288    <tr>
  1289      <td>
  1290        <code>writetimeout</code>
  1291      </td>
  1292      <td>
  1293        no
  1294      </td>
  1295      <td>
  1296        Timeout for writing to redis connections.
  1297      </td>
  1298    </tr>
  1299  </table>
  1300  
  1301  
  1302  ### pool
  1303  
  1304      pool:
  1305        maxidle: 16
  1306        maxactive: 64
  1307        idletimeout: 300s
  1308  
  1309  Configure the behavior of the Redis connection pool.
  1310  
  1311  <table>
  1312    <tr>
  1313      <th>Parameter</th>
  1314      <th>Required</th>
  1315      <th>Description</th>
  1316    </tr>
  1317    <tr>
  1318      <td>
  1319        <code>maxidle</code>
  1320      </td>
  1321      <td>
  1322        no
  1323      </td>
  1324      <td>
  1325        Sets the maximum number of idle connections.
  1326      </td>
  1327    </tr>
  1328    <tr>
  1329      <td>
  1330        <code>maxactive</code>
  1331      </td>
  1332      <td>
  1333        no
  1334      </td>
  1335      <td>
  1336        sets the maximum number of connections that should
  1337    be opened before blocking a connection request.
  1338      </td>
  1339    </tr>
  1340    <tr>
  1341      <td>
  1342        <code>idletimeout</code>
  1343      </td>
  1344      <td>
  1345        no
  1346      </td>
  1347      <td>
  1348        sets the amount time to wait before closing
  1349    inactive connections.
  1350      </td>
  1351    </tr>
  1352  </table>
  1353  
  1354  ## health
  1355  
  1356      health:
  1357        storagedriver:
  1358          enabled: true
  1359          interval: 10s
  1360          threshold: 3
  1361        file:
  1362          - file: /path/to/checked/file
  1363            interval: 10s
  1364        http:
  1365          - uri: http://server.to.check/must/return/200
  1366            headers:
  1367              Authorization: [Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==]
  1368            statuscode: 200
  1369            timeout: 3s
  1370            interval: 10s
  1371            threshold: 3
  1372        tcp:
  1373          - addr: redis-server.domain.com:6379
  1374            timeout: 3s
  1375            interval: 10s
  1376            threshold: 3
  1377  
  1378  The health option is **optional**. It may contain preferences for a periodic
  1379  health check on the storage driver's backend storage, and optional periodic
  1380  checks on local files, HTTP URIs, and/or TCP servers. The results of the health
  1381  checks are available at /debug/health on the debug HTTP server if the debug
  1382  HTTP server is enabled (see http section).
  1383  
  1384  ### storagedriver
  1385  
  1386  storagedriver contains options for a health check on the configured storage
  1387  driver's backend storage. enabled must be set to true for this health check to
  1388  be active.
  1389  
  1390  <table>
  1391    <tr>
  1392      <th>Parameter</th>
  1393      <th>Required</th>
  1394      <th>Description</th>
  1395    </tr>
  1396    <tr>
  1397      <td>
  1398        <code>enabled</code>
  1399      </td>
  1400      <td>
  1401        yes
  1402      </td>
  1403      <td>
  1404  "true" to enable the storage driver health check or "false" to disable it.
  1405  </td>
  1406    </tr>
  1407    <tr>
  1408      <td>
  1409        <code>interval</code>
  1410      </td>
  1411      <td>
  1412        no
  1413      </td>
  1414      <td>
  1415        The length of time to wait between repetitions of the check. This field
  1416        takes a positive integer and an optional suffix indicating the unit of
  1417        time. Possible units are:
  1418        <ul>
  1419          <li><code>ns</code> (nanoseconds)</li>
  1420          <li><code>us</code> (microseconds)</li>
  1421          <li><code>ms</code> (milliseconds)</li>
  1422          <li><code>s</code> (seconds)</li>
  1423          <li><code>m</code> (minutes)</li>
  1424          <li><code>h</code> (hours)</li>
  1425        </ul>
  1426      If you omit the suffix, the system interprets the value as nanoseconds.
  1427      The default value is 10 seconds if this field is omitted.
  1428      </td>
  1429    </tr>
  1430    <tr>
  1431      <td>
  1432        <code>threshold</code>
  1433      </td>
  1434      <td>
  1435        no
  1436      </td>
  1437      <td>
  1438        An integer specifying the number of times the check must fail before the
  1439        check triggers an unhealthy state. If this filed is not specified, a
  1440        single failure will trigger an unhealthy state.
  1441      </td>
  1442    </tr>
  1443  </table>
  1444  
  1445  ### file
  1446  
  1447  file is a list of paths to be periodically checked for the existence of a file.
  1448  If a file exists at the given path, the health check will fail. This can be
  1449  used as a way of bringing a registry out of rotation by creating a file.
  1450  
  1451  <table>
  1452    <tr>
  1453      <th>Parameter</th>
  1454      <th>Required</th>
  1455      <th>Description</th>
  1456    </tr>
  1457    <tr>
  1458      <td>
  1459        <code>file</code>
  1460      </td>
  1461      <td>
  1462        yes
  1463      </td>
  1464      <td>
  1465  The path to check for the existence of a file.
  1466  </td>
  1467    </tr>
  1468    <tr>
  1469      <td>
  1470        <code>interval</code>
  1471      </td>
  1472      <td>
  1473        no
  1474      </td>
  1475      <td>
  1476        The length of time to wait between repetitions of the check. This field
  1477        takes a positive integer and an optional suffix indicating the unit of
  1478        time. Possible units are:
  1479        <ul>
  1480          <li><code>ns</code> (nanoseconds)</li>
  1481          <li><code>us</code> (microseconds)</li>
  1482          <li><code>ms</code> (milliseconds)</li>
  1483          <li><code>s</code> (seconds)</li>
  1484          <li><code>m</code> (minutes)</li>
  1485          <li><code>h</code> (hours)</li>
  1486        </ul>
  1487      If you omit the suffix, the system interprets the value as nanoseconds.
  1488      The default value is 10 seconds if this field is omitted.
  1489      </td>
  1490    </tr>
  1491  </table>
  1492  
  1493  ### http
  1494  
  1495  http is a list of HTTP URIs to be periodically checked with HEAD requests. If
  1496  a HEAD request doesn't complete or returns an unexpected status code, the
  1497  health check will fail.
  1498  
  1499  <table>
  1500    <tr>
  1501      <th>Parameter</th>
  1502      <th>Required</th>
  1503      <th>Description</th>
  1504    </tr>
  1505    <tr>
  1506      <td>
  1507        <code>uri</code>
  1508      </td>
  1509      <td>
  1510        yes
  1511      </td>
  1512      <td>
  1513  The URI to check.
  1514  </td>
  1515    </tr>
  1516     <tr>
  1517      <td>
  1518        <code>headers</code>
  1519      </td>
  1520      <td>
  1521        no
  1522      </td>
  1523      <td>
  1524        Static headers to add to each request. Each header's name should be a key
  1525        underneath headers, and each value is a list of payloads for that
  1526        header name. Note that values must always be lists.
  1527      </td>
  1528    </tr>
  1529    <tr>
  1530      <td>
  1531        <code>statuscode</code>
  1532      </td>
  1533      <td>
  1534        no
  1535      </td>
  1536      <td>
  1537  Expected status code from the HTTP URI. Defaults to 200.
  1538  </td>
  1539    </tr>
  1540    <tr>
  1541      <td>
  1542        <code>timeout</code>
  1543      </td>
  1544      <td>
  1545        no
  1546      </td>
  1547      <td>
  1548        The length of time to wait before timing out the HTTP request. This field
  1549        takes a positive integer and an optional suffix indicating the unit of
  1550        time. Possible units are:
  1551        <ul>
  1552          <li><code>ns</code> (nanoseconds)</li>
  1553          <li><code>us</code> (microseconds)</li>
  1554          <li><code>ms</code> (milliseconds)</li>
  1555          <li><code>s</code> (seconds)</li>
  1556          <li><code>m</code> (minutes)</li>
  1557          <li><code>h</code> (hours)</li>
  1558        </ul>
  1559      If you omit the suffix, the system interprets the value as nanoseconds.
  1560      </td>
  1561    </tr>
  1562    <tr>
  1563      <td>
  1564        <code>interval</code>
  1565      </td>
  1566      <td>
  1567        no
  1568      </td>
  1569      <td>
  1570        The length of time to wait between repetitions of the check. This field
  1571        takes a positive integer and an optional suffix indicating the unit of
  1572        time. Possible units are:
  1573        <ul>
  1574          <li><code>ns</code> (nanoseconds)</li>
  1575          <li><code>us</code> (microseconds)</li>
  1576          <li><code>ms</code> (milliseconds)</li>
  1577          <li><code>s</code> (seconds)</li>
  1578          <li><code>m</code> (minutes)</li>
  1579          <li><code>h</code> (hours)</li>
  1580        </ul>
  1581      If you omit the suffix, the system interprets the value as nanoseconds.
  1582      The default value is 10 seconds if this field is omitted.
  1583      </td>
  1584    </tr>
  1585    <tr>
  1586      <td>
  1587        <code>threshold</code>
  1588      </td>
  1589      <td>
  1590        no
  1591      </td>
  1592      <td>
  1593        An integer specifying the number of times the check must fail before the
  1594        check triggers an unhealthy state. If this filed is not specified, a
  1595        single failure will trigger an unhealthy state.
  1596      </td>
  1597    </tr>
  1598  </table>
  1599  
  1600  ### tcp
  1601  
  1602  tcp is a list of TCP addresses to be periodically checked with connection
  1603  attempts. The addresses must include port numbers. If a connection attempt
  1604  fails, the health check will fail.
  1605  
  1606  <table>
  1607    <tr>
  1608      <th>Parameter</th>
  1609      <th>Required</th>
  1610      <th>Description</th>
  1611    </tr>
  1612    <tr>
  1613      <td>
  1614        <code>addr</code>
  1615      </td>
  1616      <td>
  1617        yes
  1618      </td>
  1619      <td>
  1620  The TCP address to connect to, including a port number.
  1621  </td>
  1622    </tr>
  1623    <tr>
  1624      <td>
  1625        <code>timeout</code>
  1626      </td>
  1627      <td>
  1628        no
  1629      </td>
  1630      <td>
  1631        The length of time to wait before timing out the TCP connection. This
  1632        field takes a positive integer and an optional suffix indicating the unit
  1633        of time. Possible units are:
  1634        <ul>
  1635          <li><code>ns</code> (nanoseconds)</li>
  1636          <li><code>us</code> (microseconds)</li>
  1637          <li><code>ms</code> (milliseconds)</li>
  1638          <li><code>s</code> (seconds)</li>
  1639          <li><code>m</code> (minutes)</li>
  1640          <li><code>h</code> (hours)</li>
  1641        </ul>
  1642      If you omit the suffix, the system interprets the value as nanoseconds.
  1643      </td>
  1644    </tr>
  1645    <tr>
  1646      <td>
  1647        <code>interval</code>
  1648      </td>
  1649      <td>
  1650        no
  1651      </td>
  1652      <td>
  1653        The length of time to wait between repetitions of the check. This field
  1654        takes a positive integer and an optional suffix indicating the unit of
  1655        time. Possible units are:
  1656        <ul>
  1657          <li><code>ns</code> (nanoseconds)</li>
  1658          <li><code>us</code> (microseconds)</li>
  1659          <li><code>ms</code> (milliseconds)</li>
  1660          <li><code>s</code> (seconds)</li>
  1661          <li><code>m</code> (minutes)</li>
  1662          <li><code>h</code> (hours)</li>
  1663        </ul>
  1664      If you omit the suffix, the system interprets the value as nanoseconds.
  1665      The default value is 10 seconds if this field is omitted.
  1666      </td>
  1667    </tr>
  1668    <tr>
  1669      <td>
  1670        <code>threshold</code>
  1671      </td>
  1672      <td>
  1673        no
  1674      </td>
  1675      <td>
  1676        An integer specifying the number of times the check must fail before the
  1677        check triggers an unhealthy state. If this filed is not specified, a
  1678        single failure will trigger an unhealthy state.
  1679      </td>
  1680    </tr>
  1681  </table>
  1682  
  1683  ## Proxy
  1684  
  1685      proxy:
  1686        remoteurl: https://registry-1.docker.io
  1687        username: [username]
  1688        password: [password]
  1689  
  1690  Proxy enables a registry to be configured as a pull through cache to the official Docker Hub.  See [mirror](mirror.md) for more information. Pushing to a registry configured as a pull through cache is currently unsupported.
  1691  
  1692  <table>
  1693    <tr>
  1694      <th>Parameter</th>
  1695      <th>Required</th>
  1696      <th>Description</th>
  1697    </tr>
  1698    <tr>
  1699      <td>
  1700        <code>remoteurl</code>
  1701      </td>
  1702      <td>
  1703        yes
  1704      </td>
  1705      <td>
  1706       The URL of the official Docker Hub
  1707      </td>
  1708    </tr>
  1709    <tr>
  1710      <td>
  1711        <code>username</code>
  1712      </td>
  1713      <td>
  1714        no
  1715      </td>
  1716      <td>
  1717       The username of the Docker Hub account
  1718      </td>
  1719    </tr>
  1720    <tr>
  1721      <td>
  1722        <code>password</code>
  1723      </td>
  1724      <td>
  1725        no
  1726      </td>
  1727      <td>
  1728       The password for the official Docker Hub account
  1729      </td>
  1730    </tr>
  1731  </table>
  1732  
  1733  To enable pulling private repositories (e.g. `batman/robin`) a username and password for user `batman` must be specified.  Note: These private repositories will be stored in the proxy cache's storage and relevant measures should be taken to protect access to this.
  1734  
  1735  
  1736  ## Example: Development configuration
  1737  
  1738  The following is a simple example you can use for local development:
  1739  
  1740      version: 0.1
  1741      log:
  1742        level: debug
  1743      storage:
  1744          filesystem:
  1745              rootdirectory: /var/lib/registry
  1746      http:
  1747          addr: localhost:5000
  1748          secret: asecretforlocaldevelopment
  1749          debug:
  1750              addr: localhost:5001
  1751  
  1752  The above configures the registry instance to run on port `5000`, binding to
  1753  `localhost`, with the `debug` server enabled. Registry data storage is in the
  1754  `/var/lib/registry` directory. Logging is in `debug` mode, which is the most
  1755  verbose.
  1756  
  1757  A similar simple configuration is available at
  1758  [config-example.yml](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml).
  1759  Both are generally useful for local development.
  1760  
  1761  
  1762  ## Example: Middleware configuration
  1763  
  1764  This example illustrates how to configure storage middleware in a registry.
  1765  Middleware allows the registry to serve layers via a content delivery network
  1766  (CDN). This is useful for reducing requests to the storage layer.
  1767  
  1768  Currently, the registry supports [Amazon
  1769  Cloudfront](http://aws.amazon.com/cloudfront/). You can only use Cloudfront in
  1770  conjunction with the S3 storage driver.
  1771  
  1772  <table>
  1773    <tr>
  1774      <th>Parameter</th>
  1775      <th>Description</th>
  1776    </tr>
  1777    <tr>
  1778      <td><code>name</code></td>
  1779      <td>The storage middleware name. Currently <code>cloudfront</code> is an accepted value.</td>
  1780    </tr>
  1781    <tr>
  1782      <td><code>disabled<code></td>
  1783      <td>Set to <code>false</code> to easily disable the middleware.</td>
  1784    </tr>
  1785    <tr>
  1786      <td><code>options:</code></td>
  1787      <td>
  1788      A set of key/value options to configure the middleware.
  1789      <ul>
  1790      <li><code>baseurl:</code> The Cloudfront base URL.</li>
  1791      <li><code>privatekey:</code> The location of your AWS private key on the filesystem. </li>
  1792      <li><code>keypairid:</code> The ID of your Cloudfront keypair. </li>
  1793      <li><code>duration:</code> The duration in minutes for which the URL is valid. Default is 20. </li>
  1794      </ul>
  1795      </td>
  1796    </tr>
  1797  </table>
  1798  
  1799  The following example illustrates these values:
  1800  
  1801      middleware:
  1802          storage:
  1803              - name: cloudfront
  1804                disabled: false
  1805                options:
  1806                   baseurl: http://d111111abcdef8.cloudfront.net
  1807                   privatekey: /path/to/asecret.pem
  1808                   keypairid: asecret
  1809                   duration: 60
  1810  
  1811  
  1812  >**Note**: Cloudfront keys exist separately to other AWS keys.  See
  1813  >[the documentation on AWS credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)
  1814  >for more information.