github.com/lusis/distribution@v2.0.1+incompatible/docs/spec/api.md (about)

     1  <!--GITHUB
     2  page_title: Docker Registry HTTP API V2
     3  page_description: Explains how to use registry API
     4  page_keywords: registry, service, driver, images, storage, api
     5  IGNORES-->
     6  
     7  # Docker Registry HTTP API V2
     8  
     9  ## Introduction
    10  
    11  The _Docker Registry HTTP API_ is the protocol to facilitate distribution of
    12  images to the docker engine. It interacts with instances of the docker
    13  registry, which is a service to manage information about docker images and
    14  enable their distribution. The specification covers the operation of version 2
    15  of this API, known as _Docker Registry HTTP API V2_.
    16  
    17  While the V1 registry protocol is usable, there are several problems with the
    18  architecture that have led to this new version. The main driver of this
    19  specification these changes to the docker the image format, covered in
    20  docker/docker#8093. The new, self-contained image manifest simplifies image
    21  definition and improves security. This specification will build on that work,
    22  leveraging new properties of the manifest format to improve performance,
    23  reduce bandwidth usage and decrease the likelihood of backend corruption.
    24  
    25  For relevant details and history leading up to this specification, please see
    26  the following issues:
    27  
    28  - [docker/docker#8093](https://github.com/docker/docker/issues/8093)
    29  - [docker/docker#9015](https://github.com/docker/docker/issues/9015)
    30  - [docker/docker-registry#612](https://github.com/docker/docker-registry/issues/612)
    31  
    32  ### Scope
    33  
    34  This specification covers the URL layout and protocols of the interaction
    35  between docker registry and docker core. This will affect the docker core
    36  registry API and the rewrite of docker-registry. Docker registry
    37  implementations may implement other API endpoints, but they are not covered by
    38  this specification.
    39  
    40  This includes the following features:
    41  
    42  - Namespace-oriented URI Layout
    43  - PUSH/PULL registry server for V2 image manifest format
    44  - Resumable layer PUSH support
    45  - V2 Client library implementation
    46  
    47  While authentication and authorization support will influence this
    48  specification, details of the protocol will be left to a future specification.
    49  Relevant header definitions and error codes are present to provide an
    50  indication of what a client may encounter.
    51  
    52  #### Future
    53  
    54  There are features that have been discussed during the process of cutting this
    55  specification. The following is an incomplete list:
    56  
    57  - Immutable image references
    58  - Multiple architecture support
    59  - Migration from v2compatibility representation
    60  
    61  These may represent features that are either out of the scope of this
    62  specification, the purview of another specification or have been deferred to a
    63  future version.
    64  
    65  ### Use Cases
    66  
    67  For the most part, the use cases of the former registry API apply to the new
    68  version. Differentiating use cases are covered below.
    69  
    70  #### Image Verification
    71  
    72  A docker engine instance would like to run verified image named
    73  "library/ubuntu", with the tag "latest". The engine contacts the registry,
    74  requesting the manifest for "library/ubuntu:latest". An untrusted registry
    75  returns a manifest. Before proceeding to download the individual layers, the
    76  engine verifies the manifest's signature, ensuring that the content was
    77  produced from a trusted source and no tampering has occured. After each layer
    78  is downloaded, the engine verifies the digest of the layer, ensuring that the
    79  content matches that specified by the manifest.
    80  
    81  #### Resumable Push
    82  
    83  Company X's build servers lose connectivity to docker registry before
    84  completing an image layer transfer. After connectivity returns, the build
    85  server attempts to re-upload the image. The registry notifies the build server
    86  that the upload has already been partially attempted. The build server
    87  responds by only sending the remaining data to complete the image file.
    88  
    89  #### Resumable Pull
    90  
    91  Company X is having more connectivity problems but this time in their
    92  deployment datacenter. When downloading an image, the connection is
    93  interrupted before completion. The client keeps the partial data and uses http
    94  `Range` requests to avoid downloading repeated data.
    95  
    96  #### Layer Upload De-duplication
    97  
    98  Company Y's build system creates two identical docker layers from build
    99  processes A and B. Build process A completes uploading the layer before B.
   100  When process B attempts to upload the layer, the registry indicates that its
   101  not necessary because the layer is already known.
   102  
   103  If process A and B upload the same layer at the same time, both operations
   104  will proceed and the first to complete will be stored in the registry (Note:
   105  we may modify this to prevent dogpile with some locking mechanism).
   106  
   107  ### Changes
   108  
   109  The V2 specification has been written to work as a living document, specifying
   110  only what is certain and leaving what is not specified open or to future
   111  changes. Only non-conflicting additions should be made to the API and accepted
   112  changes should avoid preventing future changes from happening.
   113  
   114  This section should be updated when changes are made to the specification,
   115  indicating what is different. Optionally, we may start marking parts of the
   116  specification to correspond with the versions enumerated here.
   117  
   118  <dl>
   119  	<dt>2.0.1</dt>
   120  	<dd>
   121  		<ul>
   122  			<li>Added capability of doing streaming upload to PATCH blob upload.</li>
   123  			<li>Updated PUT blob upload to no longer take final chunk, now requires entire data or no data.</li>
   124  			<li>Removed `416 Requested Range Not Satisfiable` response status from PUT blob upload.</li>
   125  		</ul>
   126  	</dd>
   127  
   128  	<dt>2.0.0</dt>
   129  	<dd>
   130  		<ul>
   131  			<li>Added support for immutable manifest references in manifest endpoints.</li>
   132  			<li>Deleting a manifest by tag has been deprecated.</li>
   133  			<li>Specified `Docker-Content-Digest` header for appropriate entities.</li>
   134  			<li>Added error code for unsupported operations.</li>
   135  			<li>Added capability of doing streaming upload to PATCH blob upload.</li>
   136  			<li>Updated PUT blob upload to no longer take final chunk, now requires entire data or no data.</li>
   137  			<li>Removed 416 return code from PUT blob upload.</li>
   138  		</ul>
   139  	</dd>
   140  
   141  	<dt>2.0</dt>
   142  	<dd>
   143  		This is the baseline specification.
   144  	</dd>
   145  </dl>
   146  
   147  ## Overview
   148  
   149  This section covers client flows and details of the API endpoints. The URI
   150  layout of the new API is structured to support a rich authentication and
   151  authorization model by leveraging namespaces. All endpoints will be prefixed
   152  by the API version and the repository name:
   153  
   154      /v2/<name>/
   155  
   156  For example, an API endpoint that will work with the `library/ubuntu`
   157  repository, the URI prefix will be:
   158  
   159      /v2/library/ubuntu/
   160  
   161  This scheme provides rich access control over various operations and methods
   162  using the URI prefix and http methods that can be controlled in variety of
   163  ways.
   164  
   165  Classically, repository names have always been two path components where each
   166  path component is less than 30 characters. The V2 registry API does not
   167  enforce this. The rules for a repository name are as follows:
   168  
   169  1. A repository name is broken up into _path components_. A component of a
   170     repository name must be at least two lowercase, alpha-numeric characters,
   171     optionally separated by periods, dashes or underscores. More strictly, it
   172     must match the regular expression `[a-z0-9]+(?:[._-][a-z0-9]+)*` and the
   173     matched result must be 2 or more characters in length.
   174  2. The name of a repository must have at least two path components, separated
   175     by a forward slash.
   176  3. The total length of a repository name, including slashes, must be less the
   177     256 characters.
   178  
   179  These name requirements _only_ apply to the registry API and should accept a
   180  superset of what is supported by other docker ecosystem components.
   181  
   182  All endpoints should support aggressive http caching, compression and range
   183  headers, where appropriate. The new API attempts to leverage HTTP semantics
   184  where possible but may break from standards to implement targeted features.
   185  
   186  For detail on individual endpoints, please see the [_Detail_](#detail)
   187  section.
   188  
   189  ### Errors
   190  
   191  Actionable failure conditions, covered in detail in their relevant sections,
   192  are reported as part of 4xx responses, in a json response body. One or more
   193  errors will be returned in the following format:
   194  
   195      {
   196          "errors:" [{
   197                  "code": <error identifier>,
   198                  "message": <message describing condition>,
   199                  "detail": <unstructured>
   200              },
   201              ...
   202          ]
   203      }
   204  
   205  The `code` field will be a unique identifier, all caps with underscores by
   206  convention. The `message` field will be a human readable string. The optional
   207  `detail` field may contain arbitrary json data providing information the
   208  client can use to resolve the issue.
   209  
   210  While the client can take action on certain error codes, the registry may add
   211  new error codes over time. All client implementations should treat unknown
   212  error codes as `UNKNOWN`, allowing future error codes to be added without
   213  breaking API compatibility. For the purposes of the specification error codes
   214  will only be added and never removed.
   215  
   216  For a complete account of all error codes, please see the _Detail_ section.
   217  
   218  ### API Version Check
   219  
   220  A minimal endpoint, mounted at `/v2/` will provide version support information
   221  based on its response statuses. The request format is as follows:
   222  
   223      GET /v2/
   224  
   225  If a `200 OK` response is returned, the registry implements the V2(.1)
   226  registry API and the client may proceed safely with other V2 operations.
   227  Optionally, the response may contain information about the supported paths in
   228  the response body. The client should be prepared to ignore this data.
   229  
   230  If a `401 Unauthorized` response is returned, the client should take action
   231  based on the contents of the "WWW-Authenticate" header and try the endpoint
   232  again. Depending on access control setup, the client may still have to
   233  authenticate against different resources, even if this check succeeds.
   234  
   235  If `404 Not Found` response status, or other unexpected status, is returned,
   236  the client should proceed with the assumption that the registry does not
   237  implement V2 of the API.
   238  
   239  When a `200 OK` or `401 Unauthorized` response is returned, the
   240  "Docker-Distribution-API-Version" header should be set to "registry/2.0".
   241  Clients may require this header value to determine if the endpoint serves this
   242  API. When this header is omitted, clients may fallback to an older API version.
   243  
   244  ### Pulling An Image
   245  
   246  An "image" is a combination of a JSON manifest and individual layer files. The
   247  process of pulling an image centers around retrieving these two components.
   248  
   249  The first step in pulling an image is to retrieve the manifest. For reference,
   250  the relevant manifest fields for the registry are the following:
   251  
   252   field    | description                                    |
   253  ----------|------------------------------------------------|
   254  name      | The name of the image.                         |
   255  tag       | The tag for this version of the image.         |
   256  fsLayers  | A list of layer descriptors (including tarsum) |
   257  signature | A JWS used to verify the manifest content      |
   258  
   259  For more information about the manifest format, please see
   260  [docker/docker#8093](https://github.com/docker/docker/issues/8093).
   261  
   262  When the manifest is in hand, the client must verify the signature to ensure
   263  the names and layers are valid. Once confirmed, the client will then use the
   264  tarsums to download the individual layers. Layers are stored in as blobs in
   265  the V2 registry API, keyed by their tarsum digest.
   266  
   267  #### Pulling an Image Manifest
   268  
   269  The image manifest can be fetched with the following url:
   270  
   271  ```
   272  GET /v2/<name>/manifests/<reference>
   273  ```
   274  
   275  The `name` and `reference` parameter identify the image and are required. The
   276  reference may include a tag or digest.
   277  
   278  A `404 Not Found` response will be returned if the image is unknown to the
   279  registry. If the image exists and the response is successful, the image
   280  manifest will be returned, with the following format (see docker/docker#8093
   281  for details):
   282  
   283      {
   284         "name": <name>,
   285         "tag": <tag>,
   286         "fsLayers": [
   287            {
   288               "blobSum": <tarsum>
   289            },
   290            ...
   291          ]
   292         ],
   293         "history": <v1 images>,
   294         "signature": <JWS>
   295      }
   296  
   297  The client should verify the returned manifest signature for authenticity
   298  before fetching layers.
   299  
   300  #### Pulling a Layer
   301  
   302  Layers are stored in the blob portion of the registry, keyed by tarsum digest.
   303  Pulling a layer is carried out by a standard http request. The URL is as
   304  follows:
   305  
   306      GET /v2/<name>/blobs/<tarsum>
   307  
   308  Access to a layer will be gated by the `name` of the repository but is
   309  identified uniquely in the registry by `tarsum`. The `tarsum` parameter is an
   310  opaque field, to be interpreted by the tarsum library.
   311  
   312  This endpoint may issue a 307 (302 for <HTTP 1.1) redirect to another service
   313  for downloading the layer and clients should be prepared to handle redirects.
   314  
   315  This endpoint should support aggressive HTTP caching for image layers. Support
   316  for Etags, modification dates and other cache control headers should be
   317  included. To allow for incremental downloads, `Range` requests should be
   318  supported, as well.
   319  
   320  ### Pushing An Image
   321  
   322  Pushing an image works in the opposite order as a pull. After assembling the
   323  image manifest, the client must first push the individual layers. When the
   324  layers are fully pushed into the registry, the client should upload the signed
   325  manifest.
   326  
   327  The details of each step of the process are covered in the following sections.
   328  
   329  #### Pushing a Layer
   330  
   331  All layer uploads use two steps to manage the upload process. The first step
   332  starts the upload in the registry service, returning a url to carry out the
   333  second step. The second step uses the upload url to transfer the actual data.
   334  Uploads are started with a POST request which returns a url that can be used
   335  to push data and check upload status.
   336  
   337  The `Location` header will be used to communicate the upload location after
   338  each request. While it won't change in the this specification, clients should
   339  use the most recent value returned by the API.
   340  
   341  ##### Starting An Upload
   342  
   343  To begin the process, a POST request should be issued in the following format:
   344  
   345  ```
   346  POST /v2/<name>/blobs/uploads/
   347  ```
   348  
   349  The parameters of this request are the image namespace under which the layer
   350  will be linked. Responses to this request are covered below.
   351  
   352  ##### Existing Layers
   353  
   354  The existence of a layer can be checked via a `HEAD` request to the blob store
   355  API. The request should be formatted as follows:
   356  
   357  ```
   358  HEAD /v2/<name>/blobs/<digest>
   359  ```
   360  
   361  If the layer with the tarsum specified in `digest` is available, a 200 OK
   362  response will be received, with no actual body content (this is according to
   363  http specification). The response will look as follows:
   364  
   365  ```
   366  200 OK
   367  Content-Length: <length of blob>
   368  Docker-Content-Digest: <digest>
   369  ```
   370  
   371  When this response is received, the client can assume that the layer is
   372  already available in the registry under the given name and should take no
   373  further action to upload the layer. Note that the binary digests may differ
   374  for the existing registry layer, but the tarsums will be guaranteed to match.
   375  
   376  ##### Uploading the Layer
   377  
   378  If the POST request is successful, a `202 Accepted` response will be returned
   379  with the upload URL in the `Location` header:
   380  
   381  ```
   382  202 Accepted
   383  Location: /v2/<name>/blobs/uploads/<uuid>
   384  Range: bytes=0-<offset>
   385  Content-Length: 0
   386  Docker-Upload-UUID: <uuid>
   387  ```
   388  
   389  The rest of the upload process can be carried out with the returned url,
   390  called the "Upload URL" from the `Location` header. All responses to the
   391  upload url, whether sending data or getting status, will be in this format.
   392  Though the URI format (`/v2/<name>/blobs/uploads/<uuid>`) for the `Location`
   393  header is specified, clients should treat it as an opaque url and should never
   394  try to assemble the it. While the `uuid` parameter may be an actual UUID, this
   395  proposal imposes no constraints on the format and clients should never impose
   396  any.
   397  
   398  If clients need to correlate local upload state with remote upload state, the
   399  contents of the `Docker-Upload-UUID` header should be used. Such an id can be
   400  used to key the last used location header when implementing resumable uploads.
   401  
   402  ##### Upload Progress
   403  
   404  The progress and chunk coordination of the upload process will be coordinated
   405  through the `Range` header. While this is a non-standard use of the `Range`
   406  header, there are examples of [similar approaches](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol) in APIs with heavy use.
   407  For an upload that just started, for an example with a 1000 byte layer file,
   408  the `Range` header would be as follows:
   409  
   410  ```
   411  Range: bytes=0-0
   412  ```
   413  
   414  To get the status of an upload, issue a GET request to the upload URL:
   415  
   416  ```
   417  GET /v2/<name>/blobs/uploads/<uuid>
   418  Host: <registry host>
   419  ```
   420  
   421  The response will be similar to the above, except will return 204 status:
   422  
   423  ```
   424  204 No Content
   425  Location: /v2/<name>/blobs/uploads/<uuid>
   426  Range: bytes=0-<offset>
   427  Docker-Upload-UUID: <uuid>
   428  ```
   429  
   430  Note that the HTTP `Range` header byte ranges are inclusive and that will be
   431  honored, even in non-standard use cases.
   432  
   433  ##### Monolithic Upload
   434  
   435  A monolithic upload is simply a chunked upload with a single chunk and may be
   436  favored by clients that would like to avoided the complexity of chunking. To
   437  carry out a "monolithic" upload, one can simply put the entire content blob to
   438  the provided URL:
   439  
   440  ```
   441  PUT /v2/<name>/blobs/uploads/<uuid>?digest=<tarsum>[&digest=sha256:<hex digest>]
   442  Content-Length: <size of layer>
   443  Content-Type: application/octet-stream
   444  
   445  <Layer Binary Data>
   446  ```
   447  
   448  The "digest" parameter must be included with the PUT request. Please see the
   449  _Completed Upload_ section for details on the parameters and expected
   450  responses.
   451  
   452  Additionally, the upload can be completed with a single `POST` request to
   453  the uploads endpoint, including the "size" and "digest" parameters:
   454  
   455  ```
   456  POST /v2/<name>/blobs/uploads/?digest=<tarsum>[&digest=sha256:<hex digest>]
   457  Content-Length: <size of layer>
   458  Content-Type: application/octet-stream
   459    
   460  <Layer Binary Data>
   461  ```
   462  
   463  On the registry service, this should allocate a download, accept and verify
   464  the data and return the same  response as the final chunk of an upload. If the
   465  POST request fails collecting the data in any way, the registry should attempt
   466  to return an error response to the client with the `Location` header providing
   467  a place to continue the download.
   468  
   469  The single `POST` method is provided for convenience and most clients should
   470  implement `POST` + `PUT` to support reliable resume of uploads.
   471    
   472  ##### Chunked Upload
   473  
   474  To carry out an upload of a chunk, the client can specify a range header and
   475  only include that part of the layer file:
   476  
   477  ```
   478  PATCH /v2/<name>/blobs/uploads/<uuid>
   479  Content-Length: <size of chunk>
   480  Content-Range: <start of range>-<end of range>
   481  Content-Type: application/octet-stream
   482  
   483  <Layer Chunk Binary Data>
   484  ```
   485  
   486  There is no enforcement on layer chunk splits other than that the server must
   487  receive them in order. The server may enforce a minimum chunk size. If the
   488  server cannot accept the chunk, a `416 Requested Range Not Satisfiable`
   489  response will be returned and will include a `Range` header indicating the
   490  current status:
   491  
   492  ```
   493  416 Requested Range Not Satisfiable
   494  Location: /v2/<name>/blobs/uploads/<uuid>
   495  Range: 0-<last valid range>
   496  Content-Length: 0
   497  Docker-Upload-UUID: <uuid>
   498  ```
   499  
   500  If this response is received, the client should resume from the "last valid
   501  range" and upload the subsequent chunk. A 416 will be returned under the
   502  following conditions:
   503  
   504  - Invalid Content-Range header format
   505  - Out of order chunk: the range of the next chunk must start immediately after
   506    the "last valid range" from the previous response.
   507  
   508  When a chunk is accepted as part of the upload, a `202 Accepted` response will
   509  be returned, including a `Range` header with the current upload status:
   510  
   511  ```
   512  202 Accepted
   513  Location: /v2/<name>/blobs/uploads/<uuid>
   514  Range: bytes=0-<offset>
   515  Content-Length: 0
   516  Docker-Upload-UUID: <uuid>
   517  ```
   518  
   519  ##### Completed Upload
   520  
   521  For an upload to be considered complete, the client must submit a `PUT`
   522  request on the upload endpoint with a digest parameter. If it is not provided,
   523  the upload will not be considered complete. The format for the final chunk
   524  will be as follows:
   525  
   526  ```
   527  PUT /v2/<name>/blob/uploads/<uuid>?digest=<tarsum>[&digest=sha256:<hex digest>]
   528  Content-Length: <size of chunk>
   529  Content-Range: <start of range>-<end of range>
   530  Content-Type: application/octet-stream
   531  
   532  <Last Layer Chunk Binary Data>
   533  ```
   534  
   535  Optionally, if all chunks have already been uploaded, a `PUT` request with a
   536  `digest` parameter and zero-length body may be sent to complete and validated
   537  the upload. Multiple "digest" parameters may be provided with different
   538  digests. The server may verify none or all of them but _must_ notify the
   539  client if the content is rejected.
   540  
   541  When the last chunk is received and the layer has been validated, the client
   542  will receive a `201 Created` response:
   543  
   544  ```
   545  201 Created
   546  Location: /v2/<name>/blobs/<tarsum>
   547  Content-Length: 0
   548  Docker-Content-Digest: <digest>
   549  ```
   550  
   551  The `Location` header will contain the registry URL to access the accepted
   552  layer file. The `Docker-Content-Digest` header returns the canonical digest of
   553  the uploaded blob which may differ from the provided digest. Most clients may
   554  ignore the value but if it is used, the client should verify the value against
   555  the uploaded blob data.
   556  
   557  ###### Digest Parameter
   558  
   559  The "digest" parameter is designed as an opaque parameter to support
   560  verification of a successful transfer. The initial version of the registry API
   561  will support a tarsum digest, in the standard tarsum format. For example, a
   562  HTTP URI parameter might be as follows:
   563  
   564  ```
   565  tarsum.v1+sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b
   566  ```
   567  
   568  Given this parameter, the registry will verify that the provided content does
   569  result in this tarsum. Optionally, the registry can support other other digest
   570  parameters for non-tarfile content stored as a layer. A regular hash digest
   571  might be specified as follows:
   572  
   573  ```
   574  sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b
   575  ```
   576  
   577  Such a parameter would be used to verify that the binary content (as opposed
   578  to the tar content) would be verified at the end of the upload process.
   579  
   580  For the initial version, registry servers are only required to support the
   581  tarsum format.
   582  
   583  ##### Canceling an Upload
   584  
   585  An upload can be cancelled by issuing a DELETE request to the upload endpoint.
   586  The format will be as follows:
   587  
   588  ```
   589  DELETE /v2/<name>/blobs/uploads/<uuid>
   590  ```
   591  
   592  After this request is issued, the upload uuid will no longer be valid and the
   593  registry server will dump all intermediate data. While uploads will time out
   594  if not completed, clients should issue this request if they encounter a fatal
   595  error but still have the ability to issue an http request.
   596  
   597  ##### Errors
   598  
   599  If an 502, 503 or 504 error is received, the client should assume that the
   600  download can proceed due to a temporary condition, honoring the appropriate
   601  retry mechanism. Other 5xx errors should be treated as terminal.
   602  
   603  If there is a problem with the upload, a 4xx error will be returned indicating
   604  the problem. After receiving a 4xx response (except 416, as called out above),
   605  the upload will be considered failed and the client should take appropriate
   606  action.
   607  
   608  Note that the upload url will not be available forever. If the upload uuid is
   609  unknown to the registry, a `404 Not Found` response will be returned and the
   610  client must restart the upload process.
   611  
   612  #### Pushing an Image Manifest
   613  
   614  Once all of the layers for an image are uploaded, the client can upload the
   615  image manifest. An image can be pushed using the following request format:
   616  
   617      PUT /v2/<name>/manifests/<reference>
   618  
   619      {
   620         "name": <name>,
   621         "tag": <tag>,
   622         "fsLayers": [
   623            {
   624               "blobSum": <tarsum>
   625            },
   626            ...
   627          ]
   628         ],
   629         "history": <v1 images>,
   630         "signature": <JWS>,
   631         ...
   632      }
   633  
   634  The `name` and `reference` fields of the response body must match those specified in
   635  the URL. The `reference` field may be a "tag" or a "digest".
   636  
   637  If there is a problem with pushing the manifest, a relevant 4xx response will
   638  be returned with a JSON error message. Please see the _PUT Manifest section
   639  for details on possible error codes that may be returned.
   640  
   641  If one or more layers are unknown to the registry, `BLOB_UNKNOWN` errors are
   642  returned. The `detail` field of the error response will have a `digest` field
   643  identifying the missing blob, which will be a tarsum. An error is returned for
   644  each unknown blob. The response format is as follows:
   645  
   646      {
   647          "errors:" [{
   648                  "code": "BLOB_UNKNOWN",
   649                  "message": "blob unknown to registry",
   650                  "detail": {
   651                      "digest": <tarsum>
   652                  }
   653              },
   654              ...
   655          ]
   656      }
   657  
   658  #### Listing Image Tags
   659  
   660  It may be necessary to list all of the tags under a given repository. The tags
   661  for an image repository can be retrieved with the following request:
   662  
   663      GET /v2/<name>/tags/list
   664  
   665  The response will be in the following format:
   666  
   667      200 OK
   668      Content-Type: application/json
   669  
   670      {
   671          "name": <name>,
   672          "tags": [
   673              <tag>,
   674              ...
   675          ]
   676      }
   677  
   678  For repositories with a large number of tags, this response may be quite
   679  large, so care should be taken by the client when parsing the response to
   680  reduce copying.
   681  
   682  ### Deleting an Image
   683  
   684  An image may be deleted from the registry via its `name` and `reference`. A
   685  delete may be issued with the following request format:
   686  
   687      DELETE /v2/<name>/manifests/<reference>
   688  
   689  For deletes, `reference` *must* be a digest or the delete will fail. If the
   690  image exists and has been successfully deleted, the following response will be
   691  issued:
   692  
   693      202 Accepted
   694      Content-Length: None
   695  
   696  If the image had already been deleted or did not exist, a `404 Not Found`
   697  response will be issued instead.
   698  
   699  ## Detail
   700  
   701  > **Note**: This section is still under construction. For the purposes of
   702  > implementation, if any details below differ from the described request flows
   703  > above, the section below should be corrected. When they match, this note
   704  > should be removed.
   705  
   706  The behavior of the endpoints are covered in detail in this section, organized
   707  by route and entity. All aspects of the request and responses are covered,
   708  including headers, parameters and body formats. Examples of requests and their
   709  corresponding responses, with success and failure, are enumerated.
   710  
   711  > **Note**: The sections on endpoint detail are arranged with an example
   712  > request, a description of the request, followed by information about that
   713  > request.
   714  
   715  A list of methods and URIs are covered in the table below:
   716  
   717  |Method|Path|Entity|Description|
   718  -------|----|------|------------
   719  | GET | `/v2/` | Base | Check that the endpoint implements Docker Registry API V2. |
   720  | GET | `/v2/<name>/tags/list` | Tags | Fetch the tags under the repository identified by `name`. |
   721  | GET | `/v2/<name>/manifests/<reference>` | Manifest | Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. |
   722  | PUT | `/v2/<name>/manifests/<reference>` | Manifest | Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest. |
   723  | DELETE | `/v2/<name>/manifests/<reference>` | Manifest | Delete the manifest identified by `name` and `reference` where `reference` can be a tag or digest. |
   724  | GET | `/v2/<name>/blobs/<digest>` | Blob | Retrieve the blob from the registry identified by `digest`. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data. |
   725  | POST | `/v2/<name>/blobs/uploads/` | Intiate Blob Upload | Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the `digest` parameter is present, the request body will be used to complete the upload in a single request. |
   726  | GET | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload. |
   727  | PATCH | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Upload a chunk of data for the specified upload. |
   728  | PUT | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Complete the upload specified by `uuid`, optionally appending the body as the final chunk. |
   729  | DELETE | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout. |
   730  
   731  
   732  The detail for each endpoint is covered in the following sections.
   733  
   734  ### Errors
   735  
   736  The error codes encountered via the API are enumerated in the following table:
   737  
   738  |Code|Message|Description|
   739  -------|----|------|------------
   740   `UNKNOWN` | unknown error | Generic error returned when the error does not have an API classification.
   741   `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters.
   742   `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status.
   743   `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest.
   744   `SIZE_INVALID` | provided length did not match content length | When a layer is uploaded, the provided size will be checked against the uploaded content. If they do not match, this error will be returned.
   745   `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation.
   746   `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned.
   747   `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry.
   748   `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository.
   749   `MANIFEST_INVALID` | manifest invalid | During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation.
   750   `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned.
   751   `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload.
   752   `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned.
   753   `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed.
   754  
   755  
   756  
   757  ### Base
   758  
   759  Base V2 API route. Typically, this can be used for lightweight version checks and to validate registry authorization.
   760  
   761  
   762  
   763  #### GET Base
   764  
   765  Check that the endpoint implements Docker Registry API V2.
   766  
   767  
   768  
   769  ```
   770  GET /v2/
   771  Host: <registry host>
   772  Authorization: <scheme> <token>
   773  ```
   774  
   775  
   776  
   777  
   778  The following parameters should be specified on the request:
   779  
   780  |Name|Kind|Description|
   781  |----|----|-----------|
   782  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
   783  |`Authorization`|header|An RFC7235 compliant authorization header.|
   784  
   785  
   786  
   787  
   788  ###### On Success: OK
   789  
   790  ```
   791  200 OK
   792  ```
   793  
   794  The API implements V2 protocol and is accessible.
   795  
   796  
   797  
   798  
   799  
   800  ###### On Failure: Unauthorized
   801  
   802  ```
   803  401 Unauthorized
   804  WWW-Authenticate: <scheme> realm="<realm>", ..."
   805  Content-Type: application/json; charset=utf-8
   806  
   807  {
   808  	"errors:" [
   809  	    {
   810              "code": <error code>,
   811              "message": "<error message>",
   812              "detail": ...
   813          },
   814          ...
   815      ]
   816  }
   817  ```
   818  
   819  The client is not authorized to access the registry.
   820  
   821  The following headers will be returned on the response:
   822  
   823  |Name|Description|
   824  |----|-----------|
   825  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
   826  
   827  
   828  
   829  The error codes that may be included in the response body are enumerated below:
   830  
   831  |Code|Message|Description|
   832  -------|----|------|------------
   833  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
   834  
   835  
   836  
   837  ###### On Failure: Not Found
   838  
   839  ```
   840  404 Not Found
   841  ```
   842  
   843  The registry does not implement the V2 API.
   844  
   845  
   846  
   847  
   848  
   849  ### Tags
   850  
   851  Retrieve information about tags.
   852  
   853  
   854  
   855  #### GET Tags
   856  
   857  Fetch the tags under the repository identified by `name`.
   858  
   859  
   860  
   861  ```
   862  GET /v2/<name>/tags/list
   863  Host: <registry host>
   864  Authorization: <scheme> <token>
   865  ```
   866  
   867  
   868  
   869  
   870  The following parameters should be specified on the request:
   871  
   872  |Name|Kind|Description|
   873  |----|----|-----------|
   874  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
   875  |`Authorization`|header|An RFC7235 compliant authorization header.|
   876  |`name`|path|Name of the target repository.|
   877  
   878  
   879  
   880  
   881  ###### On Success: OK
   882  
   883  ```
   884  200 OK
   885  Content-Length: <length>
   886  Content-Type: application/json; charset=utf-8
   887  
   888  {
   889      "name": <name>,
   890      "tags": [
   891          <tag>,
   892          ...
   893      ]
   894  }
   895  ```
   896  
   897  A list of tags for the named repository.
   898  
   899  The following headers will be returned with the response:
   900  
   901  |Name|Description|
   902  |----|-----------|
   903  |`Content-Length`|Length of the JSON response body.|
   904  
   905  
   906  
   907  
   908  ###### On Failure: Not Found
   909  
   910  ```
   911  404 Not Found
   912  Content-Type: application/json; charset=utf-8
   913  
   914  {
   915  	"errors:" [
   916  	    {
   917              "code": <error code>,
   918              "message": "<error message>",
   919              "detail": ...
   920          },
   921          ...
   922      ]
   923  }
   924  ```
   925  
   926  The repository is not known to the registry.
   927  
   928  
   929  
   930  The error codes that may be included in the response body are enumerated below:
   931  
   932  |Code|Message|Description|
   933  -------|----|------|------------
   934  | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
   935  
   936  
   937  
   938  ###### On Failure: Unauthorized
   939  
   940  ```
   941  401 Unauthorized
   942  Content-Type: application/json; charset=utf-8
   943  
   944  {
   945  	"errors:" [
   946  	    {
   947              "code": <error code>,
   948              "message": "<error message>",
   949              "detail": ...
   950          },
   951          ...
   952      ]
   953  }
   954  ```
   955  
   956  The client does not have access to the repository.
   957  
   958  
   959  
   960  The error codes that may be included in the response body are enumerated below:
   961  
   962  |Code|Message|Description|
   963  -------|----|------|------------
   964  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
   965  
   966  
   967  
   968  
   969  
   970  ### Manifest
   971  
   972  Create, update and retrieve manifests.
   973  
   974  
   975  
   976  #### GET Manifest
   977  
   978  Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest.
   979  
   980  
   981  
   982  ```
   983  GET /v2/<name>/manifests/<reference>
   984  Host: <registry host>
   985  Authorization: <scheme> <token>
   986  ```
   987  
   988  
   989  
   990  
   991  The following parameters should be specified on the request:
   992  
   993  |Name|Kind|Description|
   994  |----|----|-----------|
   995  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
   996  |`Authorization`|header|An RFC7235 compliant authorization header.|
   997  |`name`|path|Name of the target repository.|
   998  |`tag`|path|Tag of the target manifiest.|
   999  
  1000  
  1001  
  1002  
  1003  ###### On Success: OK
  1004  
  1005  ```
  1006  200 OK
  1007  Docker-Content-Digest: <digest>
  1008  Content-Type: application/json; charset=utf-8
  1009  
  1010  {
  1011     "name": <name>,
  1012     "tag": <tag>,
  1013     "fsLayers": [
  1014        {
  1015           "blobSum": "<digest>"
  1016        },
  1017        ...
  1018      ]
  1019     ],
  1020     "history": <v1 images>,
  1021     "signature": <JWS>
  1022  }
  1023  ```
  1024  
  1025  The manifest idenfied by `name` and `reference`. The contents can be used to identify and resolve resources required to run the specified image.
  1026  
  1027  The following headers will be returned with the response:
  1028  
  1029  |Name|Description|
  1030  |----|-----------|
  1031  |`Docker-Content-Digest`|Digest of the targeted content for the request.|
  1032  
  1033  
  1034  
  1035  
  1036  ###### On Failure: Bad Request
  1037  
  1038  ```
  1039  400 Bad Request
  1040  Content-Type: application/json; charset=utf-8
  1041  
  1042  {
  1043  	"errors:" [
  1044  	    {
  1045              "code": <error code>,
  1046              "message": "<error message>",
  1047              "detail": ...
  1048          },
  1049          ...
  1050      ]
  1051  }
  1052  ```
  1053  
  1054  The name or reference was invalid.
  1055  
  1056  
  1057  
  1058  The error codes that may be included in the response body are enumerated below:
  1059  
  1060  |Code|Message|Description|
  1061  -------|----|------|------------
  1062  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1063  | `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. |
  1064  
  1065  
  1066  
  1067  ###### On Failure: Unauthorized
  1068  
  1069  ```
  1070  401 Unauthorized
  1071  Content-Type: application/json; charset=utf-8
  1072  
  1073  {
  1074  	"errors:" [
  1075  	    {
  1076              "code": <error code>,
  1077              "message": "<error message>",
  1078              "detail": ...
  1079          },
  1080          ...
  1081      ]
  1082  }
  1083  ```
  1084  
  1085  The client does not have access to the repository.
  1086  
  1087  
  1088  
  1089  The error codes that may be included in the response body are enumerated below:
  1090  
  1091  |Code|Message|Description|
  1092  -------|----|------|------------
  1093  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1094  
  1095  
  1096  
  1097  ###### On Failure: Not Found
  1098  
  1099  ```
  1100  404 Not Found
  1101  Content-Type: application/json; charset=utf-8
  1102  
  1103  {
  1104  	"errors:" [
  1105  	    {
  1106              "code": <error code>,
  1107              "message": "<error message>",
  1108              "detail": ...
  1109          },
  1110          ...
  1111      ]
  1112  }
  1113  ```
  1114  
  1115  The named manifest is not known to the registry.
  1116  
  1117  
  1118  
  1119  The error codes that may be included in the response body are enumerated below:
  1120  
  1121  |Code|Message|Description|
  1122  -------|----|------|------------
  1123  | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
  1124  | `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository. |
  1125  
  1126  
  1127  
  1128  
  1129  #### PUT Manifest
  1130  
  1131  Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest.
  1132  
  1133  
  1134  
  1135  ```
  1136  PUT /v2/<name>/manifests/<reference>
  1137  Host: <registry host>
  1138  Authorization: <scheme> <token>
  1139  Content-Type: application/json; charset=utf-8
  1140  
  1141  {
  1142     "name": <name>,
  1143     "tag": <tag>,
  1144     "fsLayers": [
  1145        {
  1146           "blobSum": "<digest>"
  1147        },
  1148        ...
  1149      ]
  1150     ],
  1151     "history": <v1 images>,
  1152     "signature": <JWS>
  1153  }
  1154  ```
  1155  
  1156  
  1157  
  1158  
  1159  The following parameters should be specified on the request:
  1160  
  1161  |Name|Kind|Description|
  1162  |----|----|-----------|
  1163  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  1164  |`Authorization`|header|An RFC7235 compliant authorization header.|
  1165  |`name`|path|Name of the target repository.|
  1166  |`tag`|path|Tag of the target manifiest.|
  1167  
  1168  
  1169  
  1170  
  1171  ###### On Success: Accepted
  1172  
  1173  ```
  1174  202 Accepted
  1175  Location: <url>
  1176  Content-Length: 0
  1177  Docker-Content-Digest: <digest>
  1178  ```
  1179  
  1180  The manifest has been accepted by the registry and is stored under the specified `name` and `tag`.
  1181  
  1182  The following headers will be returned with the response:
  1183  
  1184  |Name|Description|
  1185  |----|-----------|
  1186  |`Location`|The canonical location url of the uploaded manifest.|
  1187  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  1188  |`Docker-Content-Digest`|Digest of the targeted content for the request.|
  1189  
  1190  
  1191  
  1192  
  1193  ###### On Failure: Invalid Manifest
  1194  
  1195  ```
  1196  400 Bad Request
  1197  Content-Type: application/json; charset=utf-8
  1198  
  1199  {
  1200  	"errors:" [
  1201  	    {
  1202              "code": <error code>,
  1203              "message": "<error message>",
  1204              "detail": ...
  1205          },
  1206          ...
  1207      ]
  1208  }
  1209  ```
  1210  
  1211  The received manifest was invalid in some way, as described by the error codes. The client should resolve the issue and retry the request.
  1212  
  1213  
  1214  
  1215  The error codes that may be included in the response body are enumerated below:
  1216  
  1217  |Code|Message|Description|
  1218  -------|----|------|------------
  1219  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1220  | `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. |
  1221  | `MANIFEST_INVALID` | manifest invalid | During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation. |
  1222  | `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned. |
  1223  | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. |
  1224  
  1225  
  1226  
  1227  ###### On Failure: Unauthorized
  1228  
  1229  ```
  1230  401 Unauthorized
  1231  Content-Type: application/json; charset=utf-8
  1232  
  1233  {
  1234  	"errors:" [
  1235  	    {
  1236              "code": <error code>,
  1237              "message": "<error message>",
  1238              "detail": ...
  1239          },
  1240          ...
  1241      ]
  1242  }
  1243  ```
  1244  
  1245  The client does not have permission to push to the repository.
  1246  
  1247  
  1248  
  1249  The error codes that may be included in the response body are enumerated below:
  1250  
  1251  |Code|Message|Description|
  1252  -------|----|------|------------
  1253  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1254  
  1255  
  1256  
  1257  ###### On Failure: Missing Layer(s)
  1258  
  1259  ```
  1260  400 Bad Request
  1261  Content-Type: application/json; charset=utf-8
  1262  
  1263  {
  1264      "errors:" [{
  1265              "code": "BLOB_UNKNOWN",
  1266              "message": "blob unknown to registry",
  1267              "detail": {
  1268                  "digest": "<digest>"
  1269              }
  1270          },
  1271          ...
  1272      ]
  1273  }
  1274  ```
  1275  
  1276  One or more layers may be missing during a manifest upload. If so, the missing layers will be enumerated in the error response.
  1277  
  1278  
  1279  
  1280  The error codes that may be included in the response body are enumerated below:
  1281  
  1282  |Code|Message|Description|
  1283  -------|----|------|------------
  1284  | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. |
  1285  
  1286  
  1287  
  1288  ###### On Failure: Unauthorized
  1289  
  1290  ```
  1291  401 Unauthorized
  1292  WWW-Authenticate: <scheme> realm="<realm>", ..."
  1293  Content-Length: <length>
  1294  Content-Type: application/json; charset=utf-8
  1295  
  1296  {
  1297  	"errors:" [
  1298  	    {
  1299              "code": <error code>,
  1300              "message": "<error message>",
  1301              "detail": ...
  1302          },
  1303          ...
  1304      ]
  1305  }
  1306  ```
  1307  
  1308  
  1309  
  1310  The following headers will be returned on the response:
  1311  
  1312  |Name|Description|
  1313  |----|-----------|
  1314  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  1315  |`Content-Length`|Length of the JSON error response body.|
  1316  
  1317  
  1318  
  1319  The error codes that may be included in the response body are enumerated below:
  1320  
  1321  |Code|Message|Description|
  1322  -------|----|------|------------
  1323  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1324  
  1325  
  1326  
  1327  
  1328  #### DELETE Manifest
  1329  
  1330  Delete the manifest identified by `name` and `reference` where `reference` can be a tag or digest.
  1331  
  1332  
  1333  
  1334  ```
  1335  DELETE /v2/<name>/manifests/<reference>
  1336  Host: <registry host>
  1337  Authorization: <scheme> <token>
  1338  ```
  1339  
  1340  
  1341  
  1342  
  1343  The following parameters should be specified on the request:
  1344  
  1345  |Name|Kind|Description|
  1346  |----|----|-----------|
  1347  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  1348  |`Authorization`|header|An RFC7235 compliant authorization header.|
  1349  |`name`|path|Name of the target repository.|
  1350  |`tag`|path|Tag of the target manifiest.|
  1351  
  1352  
  1353  
  1354  
  1355  ###### On Success: Accepted
  1356  
  1357  ```
  1358  202 Accepted
  1359  ```
  1360  
  1361  
  1362  
  1363  
  1364  
  1365  
  1366  
  1367  ###### On Failure: Invalid Name or Tag
  1368  
  1369  ```
  1370  400 Bad Request
  1371  Content-Type: application/json; charset=utf-8
  1372  
  1373  {
  1374  	"errors:" [
  1375  	    {
  1376              "code": <error code>,
  1377              "message": "<error message>",
  1378              "detail": ...
  1379          },
  1380          ...
  1381      ]
  1382  }
  1383  ```
  1384  
  1385  The specified `name` or `tag` were invalid and the delete was unable to proceed.
  1386  
  1387  
  1388  
  1389  The error codes that may be included in the response body are enumerated below:
  1390  
  1391  |Code|Message|Description|
  1392  -------|----|------|------------
  1393  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1394  | `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. |
  1395  
  1396  
  1397  
  1398  ###### On Failure: Unauthorized
  1399  
  1400  ```
  1401  401 Unauthorized
  1402  WWW-Authenticate: <scheme> realm="<realm>", ..."
  1403  Content-Length: <length>
  1404  Content-Type: application/json; charset=utf-8
  1405  
  1406  {
  1407  	"errors:" [
  1408  	    {
  1409              "code": <error code>,
  1410              "message": "<error message>",
  1411              "detail": ...
  1412          },
  1413          ...
  1414      ]
  1415  }
  1416  ```
  1417  
  1418  
  1419  
  1420  The following headers will be returned on the response:
  1421  
  1422  |Name|Description|
  1423  |----|-----------|
  1424  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  1425  |`Content-Length`|Length of the JSON error response body.|
  1426  
  1427  
  1428  
  1429  The error codes that may be included in the response body are enumerated below:
  1430  
  1431  |Code|Message|Description|
  1432  -------|----|------|------------
  1433  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1434  
  1435  
  1436  
  1437  ###### On Failure: Unknown Manifest
  1438  
  1439  ```
  1440  404 Not Found
  1441  Content-Type: application/json; charset=utf-8
  1442  
  1443  {
  1444  	"errors:" [
  1445  	    {
  1446              "code": <error code>,
  1447              "message": "<error message>",
  1448              "detail": ...
  1449          },
  1450          ...
  1451      ]
  1452  }
  1453  ```
  1454  
  1455  The specified `name` or `tag` are unknown to the registry and the delete was unable to proceed. Clients can assume the manifest was already deleted if this response is returned.
  1456  
  1457  
  1458  
  1459  The error codes that may be included in the response body are enumerated below:
  1460  
  1461  |Code|Message|Description|
  1462  -------|----|------|------------
  1463  | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
  1464  | `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository. |
  1465  
  1466  
  1467  
  1468  
  1469  
  1470  ### Blob
  1471  
  1472  Fetch the blob identified by `name` and `digest`. Used to fetch layers by digest.
  1473  
  1474  
  1475  
  1476  #### GET Blob
  1477  
  1478  Retrieve the blob from the registry identified by `digest`. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data.
  1479  
  1480  
  1481  ##### Fetch Blob
  1482  
  1483  ```
  1484  GET /v2/<name>/blobs/<digest>
  1485  Host: <registry host>
  1486  Authorization: <scheme> <token>
  1487  ```
  1488  
  1489  
  1490  
  1491  
  1492  The following parameters should be specified on the request:
  1493  
  1494  |Name|Kind|Description|
  1495  |----|----|-----------|
  1496  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  1497  |`Authorization`|header|An RFC7235 compliant authorization header.|
  1498  |`name`|path|Name of the target repository.|
  1499  |`digest`|path|Digest of desired blob.|
  1500  
  1501  
  1502  
  1503  
  1504  ###### On Success: OK
  1505  
  1506  ```
  1507  200 OK
  1508  Content-Length: <length>
  1509  Docker-Content-Digest: <digest>
  1510  Content-Type: application/octet-stream
  1511  
  1512  <blob binary data>
  1513  ```
  1514  
  1515  The blob identified by `digest` is available. The blob content will be present in the body of the request.
  1516  
  1517  The following headers will be returned with the response:
  1518  
  1519  |Name|Description|
  1520  |----|-----------|
  1521  |`Content-Length`|The length of the requested blob content.|
  1522  |`Docker-Content-Digest`|Digest of the targeted content for the request.|
  1523  
  1524  ###### On Success: Temporary Redirect
  1525  
  1526  ```
  1527  307 Temporary Redirect
  1528  Location: <blob location>
  1529  Docker-Content-Digest: <digest>
  1530  ```
  1531  
  1532  The blob identified by `digest` is available at the provided location.
  1533  
  1534  The following headers will be returned with the response:
  1535  
  1536  |Name|Description|
  1537  |----|-----------|
  1538  |`Location`|The location where the layer should be accessible.|
  1539  |`Docker-Content-Digest`|Digest of the targeted content for the request.|
  1540  
  1541  
  1542  
  1543  
  1544  ###### On Failure: Bad Request
  1545  
  1546  ```
  1547  400 Bad Request
  1548  Content-Type: application/json; charset=utf-8
  1549  
  1550  {
  1551  	"errors:" [
  1552  	    {
  1553              "code": <error code>,
  1554              "message": "<error message>",
  1555              "detail": ...
  1556          },
  1557          ...
  1558      ]
  1559  }
  1560  ```
  1561  
  1562  There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`.
  1563  
  1564  
  1565  
  1566  The error codes that may be included in the response body are enumerated below:
  1567  
  1568  |Code|Message|Description|
  1569  -------|----|------|------------
  1570  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1571  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  1572  
  1573  
  1574  
  1575  ###### On Failure: Unauthorized
  1576  
  1577  ```
  1578  401 Unauthorized
  1579  WWW-Authenticate: <scheme> realm="<realm>", ..."
  1580  Content-Length: <length>
  1581  Content-Type: application/json; charset=utf-8
  1582  
  1583  {
  1584  	"errors:" [
  1585  	    {
  1586              "code": "UNAUTHORIZED",
  1587              "message": "access to the requested resource is not authorized",
  1588              "detail": ...
  1589          },
  1590          ...
  1591      ]
  1592  }
  1593  ```
  1594  
  1595  The client does not have access to the repository.
  1596  
  1597  The following headers will be returned on the response:
  1598  
  1599  |Name|Description|
  1600  |----|-----------|
  1601  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  1602  |`Content-Length`|Length of the JSON error response body.|
  1603  
  1604  
  1605  
  1606  The error codes that may be included in the response body are enumerated below:
  1607  
  1608  |Code|Message|Description|
  1609  -------|----|------|------------
  1610  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1611  
  1612  
  1613  
  1614  ###### On Failure: Not Found
  1615  
  1616  ```
  1617  404 Not Found
  1618  Content-Type: application/json; charset=utf-8
  1619  
  1620  {
  1621  	"errors:" [
  1622  	    {
  1623              "code": <error code>,
  1624              "message": "<error message>",
  1625              "detail": ...
  1626          },
  1627          ...
  1628      ]
  1629  }
  1630  ```
  1631  
  1632  The blob, identified by `name` and `digest`, is unknown to the registry.
  1633  
  1634  
  1635  
  1636  The error codes that may be included in the response body are enumerated below:
  1637  
  1638  |Code|Message|Description|
  1639  -------|----|------|------------
  1640  | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
  1641  | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. |
  1642  
  1643  
  1644  
  1645  ##### Fetch Blob Part
  1646  
  1647  ```
  1648  GET /v2/<name>/blobs/<digest>
  1649  Host: <registry host>
  1650  Authorization: <scheme> <token>
  1651  Range: bytes=<start>-<end>
  1652  ```
  1653  
  1654  This endpoint may also support RFC7233 compliant range requests. Support can be detected by issuing a HEAD request. If the header `Accept-Range: bytes` is returned, range requests can be used to fetch partial content.
  1655  
  1656  
  1657  The following parameters should be specified on the request:
  1658  
  1659  |Name|Kind|Description|
  1660  |----|----|-----------|
  1661  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  1662  |`Authorization`|header|An RFC7235 compliant authorization header.|
  1663  |`Range`|header|HTTP Range header specifying blob chunk.|
  1664  |`name`|path|Name of the target repository.|
  1665  |`digest`|path|Digest of desired blob.|
  1666  
  1667  
  1668  
  1669  
  1670  ###### On Success: Partial Content
  1671  
  1672  ```
  1673  206 Partial Content
  1674  Content-Length: <length>
  1675  Content-Range: bytes <start>-<end>/<size>
  1676  Content-Type: application/octet-stream
  1677  
  1678  <blob binary data>
  1679  ```
  1680  
  1681  The blob identified by `digest` is available. The specified chunk of blob content will be present in the body of the request.
  1682  
  1683  The following headers will be returned with the response:
  1684  
  1685  |Name|Description|
  1686  |----|-----------|
  1687  |`Content-Length`|The length of the requested blob chunk.|
  1688  |`Content-Range`|Content range of blob chunk.|
  1689  
  1690  
  1691  
  1692  
  1693  ###### On Failure: Bad Request
  1694  
  1695  ```
  1696  400 Bad Request
  1697  Content-Type: application/json; charset=utf-8
  1698  
  1699  {
  1700  	"errors:" [
  1701  	    {
  1702              "code": <error code>,
  1703              "message": "<error message>",
  1704              "detail": ...
  1705          },
  1706          ...
  1707      ]
  1708  }
  1709  ```
  1710  
  1711  There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`.
  1712  
  1713  
  1714  
  1715  The error codes that may be included in the response body are enumerated below:
  1716  
  1717  |Code|Message|Description|
  1718  -------|----|------|------------
  1719  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1720  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  1721  
  1722  
  1723  
  1724  ###### On Failure: Unauthorized
  1725  
  1726  ```
  1727  401 Unauthorized
  1728  WWW-Authenticate: <scheme> realm="<realm>", ..."
  1729  Content-Length: <length>
  1730  Content-Type: application/json; charset=utf-8
  1731  
  1732  {
  1733  	"errors:" [
  1734  	    {
  1735              "code": "UNAUTHORIZED",
  1736              "message": "access to the requested resource is not authorized",
  1737              "detail": ...
  1738          },
  1739          ...
  1740      ]
  1741  }
  1742  ```
  1743  
  1744  The client does not have access to the repository.
  1745  
  1746  The following headers will be returned on the response:
  1747  
  1748  |Name|Description|
  1749  |----|-----------|
  1750  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  1751  |`Content-Length`|Length of the JSON error response body.|
  1752  
  1753  
  1754  
  1755  The error codes that may be included in the response body are enumerated below:
  1756  
  1757  |Code|Message|Description|
  1758  -------|----|------|------------
  1759  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1760  
  1761  
  1762  
  1763  ###### On Failure: Not Found
  1764  
  1765  ```
  1766  404 Not Found
  1767  Content-Type: application/json; charset=utf-8
  1768  
  1769  {
  1770  	"errors:" [
  1771  	    {
  1772              "code": <error code>,
  1773              "message": "<error message>",
  1774              "detail": ...
  1775          },
  1776          ...
  1777      ]
  1778  }
  1779  ```
  1780  
  1781  
  1782  
  1783  
  1784  
  1785  The error codes that may be included in the response body are enumerated below:
  1786  
  1787  |Code|Message|Description|
  1788  -------|----|------|------------
  1789  | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
  1790  | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. |
  1791  
  1792  
  1793  
  1794  ###### On Failure: Requested Range Not Satisfiable
  1795  
  1796  ```
  1797  416 Requested Range Not Satisfiable
  1798  ```
  1799  
  1800  The range specification cannot be satisfied for the requested content. This can happen when the range is not formatted correctly or if the range is outside of the valid size of the content.
  1801  
  1802  
  1803  
  1804  
  1805  
  1806  ### Intiate Blob Upload
  1807  
  1808  Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.
  1809  
  1810  
  1811  
  1812  #### POST Intiate Blob Upload
  1813  
  1814  Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the `digest` parameter is present, the request body will be used to complete the upload in a single request.
  1815  
  1816  
  1817  ##### Initiate Monolithic Blob Upload
  1818  
  1819  ```
  1820  POST /v2/<name>/blobs/uploads/?digest=<digest>
  1821  Host: <registry host>
  1822  Authorization: <scheme> <token>
  1823  Content-Length: <length of blob>
  1824  Content-Type: application/octect-stream
  1825  
  1826  <binary data>
  1827  ```
  1828  
  1829  Upload a blob identified by the `digest` parameter in single request. This upload will not be resumable unless a recoverable error is returned.
  1830  
  1831  
  1832  The following parameters should be specified on the request:
  1833  
  1834  |Name|Kind|Description|
  1835  |----|----|-----------|
  1836  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  1837  |`Authorization`|header|An RFC7235 compliant authorization header.|
  1838  |`Content-Length`|header||
  1839  |`name`|path|Name of the target repository.|
  1840  |`digest`|query|Digest of uploaded blob. If present, the upload will be completed, in a single request, with contents of the request body as the resulting blob.|
  1841  
  1842  
  1843  
  1844  
  1845  ###### On Success: Created
  1846  
  1847  ```
  1848  201 Created
  1849  Location: <blob location>
  1850  Content-Length: 0
  1851  Docker-Upload-UUID: <uuid>
  1852  ```
  1853  
  1854  The blob has been created in the registry and is available at the provided location.
  1855  
  1856  The following headers will be returned with the response:
  1857  
  1858  |Name|Description|
  1859  |----|-----------|
  1860  |`Location`||
  1861  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  1862  |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
  1863  
  1864  
  1865  
  1866  
  1867  ###### On Failure: Invalid Name or Digest
  1868  
  1869  ```
  1870  400 Bad Request
  1871  ```
  1872  
  1873  
  1874  
  1875  
  1876  
  1877  The error codes that may be included in the response body are enumerated below:
  1878  
  1879  |Code|Message|Description|
  1880  -------|----|------|------------
  1881  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  1882  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1883  
  1884  
  1885  
  1886  ###### On Failure: Unauthorized
  1887  
  1888  ```
  1889  401 Unauthorized
  1890  WWW-Authenticate: <scheme> realm="<realm>", ..."
  1891  Content-Length: <length>
  1892  Content-Type: application/json; charset=utf-8
  1893  
  1894  {
  1895  	"errors:" [
  1896  	    {
  1897              "code": "UNAUTHORIZED",
  1898              "message": "access to the requested resource is not authorized",
  1899              "detail": ...
  1900          },
  1901          ...
  1902      ]
  1903  }
  1904  ```
  1905  
  1906  The client does not have access to push to the repository.
  1907  
  1908  The following headers will be returned on the response:
  1909  
  1910  |Name|Description|
  1911  |----|-----------|
  1912  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  1913  |`Content-Length`|Length of the JSON error response body.|
  1914  
  1915  
  1916  
  1917  The error codes that may be included in the response body are enumerated below:
  1918  
  1919  |Code|Message|Description|
  1920  -------|----|------|------------
  1921  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  1922  
  1923  
  1924  
  1925  ##### Initiate Resumable Blob Upload
  1926  
  1927  ```
  1928  POST /v2/<name>/blobs/uploads/
  1929  Host: <registry host>
  1930  Authorization: <scheme> <token>
  1931  Content-Length: 0
  1932  ```
  1933  
  1934  Initiate a resumable blob upload with an empty request body.
  1935  
  1936  
  1937  The following parameters should be specified on the request:
  1938  
  1939  |Name|Kind|Description|
  1940  |----|----|-----------|
  1941  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  1942  |`Authorization`|header|An RFC7235 compliant authorization header.|
  1943  |`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.|
  1944  |`name`|path|Name of the target repository.|
  1945  
  1946  
  1947  
  1948  
  1949  ###### On Success: Accepted
  1950  
  1951  ```
  1952  202 Accepted
  1953  Content-Length: 0
  1954  Location: /v2/<name>/blobs/uploads/<uuid>
  1955  Range: 0-0
  1956  Docker-Upload-UUID: <uuid>
  1957  ```
  1958  
  1959  The upload has been created. The `Location` header must be used to complete the upload. The response should be identical to a `GET` request on the contents of the returned `Location` header.
  1960  
  1961  The following headers will be returned with the response:
  1962  
  1963  |Name|Description|
  1964  |----|-----------|
  1965  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  1966  |`Location`|The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
  1967  |`Range`|Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.|
  1968  |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
  1969  
  1970  
  1971  
  1972  
  1973  ###### On Failure: Invalid Name or Digest
  1974  
  1975  ```
  1976  400 Bad Request
  1977  ```
  1978  
  1979  
  1980  
  1981  
  1982  
  1983  The error codes that may be included in the response body are enumerated below:
  1984  
  1985  |Code|Message|Description|
  1986  -------|----|------|------------
  1987  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  1988  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  1989  
  1990  
  1991  
  1992  ###### On Failure: Unauthorized
  1993  
  1994  ```
  1995  401 Unauthorized
  1996  WWW-Authenticate: <scheme> realm="<realm>", ..."
  1997  Content-Length: <length>
  1998  Content-Type: application/json; charset=utf-8
  1999  
  2000  {
  2001  	"errors:" [
  2002  	    {
  2003              "code": "UNAUTHORIZED",
  2004              "message": "access to the requested resource is not authorized",
  2005              "detail": ...
  2006          },
  2007          ...
  2008      ]
  2009  }
  2010  ```
  2011  
  2012  The client does not have access to push to the repository.
  2013  
  2014  The following headers will be returned on the response:
  2015  
  2016  |Name|Description|
  2017  |----|-----------|
  2018  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  2019  |`Content-Length`|Length of the JSON error response body.|
  2020  
  2021  
  2022  
  2023  The error codes that may be included in the response body are enumerated below:
  2024  
  2025  |Code|Message|Description|
  2026  -------|----|------|------------
  2027  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  2028  
  2029  
  2030  
  2031  
  2032  
  2033  ### Blob Upload
  2034  
  2035  Interact with blob uploads. Clients should never assemble URLs for this endpoint and should only take it through the `Location` header on related API requests. The `Location` header and its parameters should be preserved by clients, using the latest value returned via upload related API calls.
  2036  
  2037  
  2038  
  2039  #### GET Blob Upload
  2040  
  2041  Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload.
  2042  
  2043  
  2044  
  2045  ```
  2046  GET /v2/<name>/blobs/uploads/<uuid>
  2047  Host: <registry host>
  2048  Authorization: <scheme> <token>
  2049  ```
  2050  
  2051  Retrieve the progress of the current upload, as reported by the `Range` header.
  2052  
  2053  
  2054  The following parameters should be specified on the request:
  2055  
  2056  |Name|Kind|Description|
  2057  |----|----|-----------|
  2058  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  2059  |`Authorization`|header|An RFC7235 compliant authorization header.|
  2060  |`name`|path|Name of the target repository.|
  2061  |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
  2062  
  2063  
  2064  
  2065  
  2066  ###### On Success: Upload Progress
  2067  
  2068  ```
  2069  204 No Content
  2070  Range: 0-<offset>
  2071  Content-Length: 0
  2072  Docker-Upload-UUID: <uuid>
  2073  ```
  2074  
  2075  The upload is known and in progress. The last received offset is available in the `Range` header.
  2076  
  2077  The following headers will be returned with the response:
  2078  
  2079  |Name|Description|
  2080  |----|-----------|
  2081  |`Range`|Range indicating the current progress of the upload.|
  2082  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  2083  |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
  2084  
  2085  
  2086  
  2087  
  2088  ###### On Failure: Bad Request
  2089  
  2090  ```
  2091  400 Bad Request
  2092  Content-Type: application/json; charset=utf-8
  2093  
  2094  {
  2095  	"errors:" [
  2096  	    {
  2097              "code": <error code>,
  2098              "message": "<error message>",
  2099              "detail": ...
  2100          },
  2101          ...
  2102      ]
  2103  }
  2104  ```
  2105  
  2106  There was an error processing the upload and it must be restarted.
  2107  
  2108  
  2109  
  2110  The error codes that may be included in the response body are enumerated below:
  2111  
  2112  |Code|Message|Description|
  2113  -------|----|------|------------
  2114  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  2115  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  2116  | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
  2117  
  2118  
  2119  
  2120  ###### On Failure: Unauthorized
  2121  
  2122  ```
  2123  401 Unauthorized
  2124  WWW-Authenticate: <scheme> realm="<realm>", ..."
  2125  Content-Length: <length>
  2126  Content-Type: application/json; charset=utf-8
  2127  
  2128  {
  2129  	"errors:" [
  2130  	    {
  2131              "code": "UNAUTHORIZED",
  2132              "message": "access to the requested resource is not authorized",
  2133              "detail": ...
  2134          },
  2135          ...
  2136      ]
  2137  }
  2138  ```
  2139  
  2140  The client does not have access to the repository.
  2141  
  2142  The following headers will be returned on the response:
  2143  
  2144  |Name|Description|
  2145  |----|-----------|
  2146  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  2147  |`Content-Length`|Length of the JSON error response body.|
  2148  
  2149  
  2150  
  2151  The error codes that may be included in the response body are enumerated below:
  2152  
  2153  |Code|Message|Description|
  2154  -------|----|------|------------
  2155  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  2156  
  2157  
  2158  
  2159  ###### On Failure: Not Found
  2160  
  2161  ```
  2162  404 Not Found
  2163  Content-Type: application/json; charset=utf-8
  2164  
  2165  {
  2166  	"errors:" [
  2167  	    {
  2168              "code": <error code>,
  2169              "message": "<error message>",
  2170              "detail": ...
  2171          },
  2172          ...
  2173      ]
  2174  }
  2175  ```
  2176  
  2177  The upload is unknown to the registry. The upload must be restarted.
  2178  
  2179  
  2180  
  2181  The error codes that may be included in the response body are enumerated below:
  2182  
  2183  |Code|Message|Description|
  2184  -------|----|------|------------
  2185  | `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. |
  2186  
  2187  
  2188  
  2189  
  2190  #### PATCH Blob Upload
  2191  
  2192  Upload a chunk of data for the specified upload.
  2193  
  2194  
  2195  ##### Stream upload
  2196  
  2197  ```
  2198  PATCH /v2/<name>/blobs/uploads/<uuid>
  2199  Host: <registry host>
  2200  Authorization: <scheme> <token>
  2201  Content-Type: application/octet-stream
  2202  
  2203  <binary data>
  2204  ```
  2205  
  2206  Upload a stream of data to upload without completing the upload.
  2207  
  2208  
  2209  The following parameters should be specified on the request:
  2210  
  2211  |Name|Kind|Description|
  2212  |----|----|-----------|
  2213  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  2214  |`Authorization`|header|An RFC7235 compliant authorization header.|
  2215  |`name`|path|Name of the target repository.|
  2216  |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
  2217  
  2218  
  2219  
  2220  
  2221  ###### On Success: Data Accepted
  2222  
  2223  ```
  2224  204 No Content
  2225  Location: /v2/<name>/blobs/uploads/<uuid>
  2226  Range: 0-<offset>
  2227  Content-Length: 0
  2228  Docker-Upload-UUID: <uuid>
  2229  ```
  2230  
  2231  The stream of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.
  2232  
  2233  The following headers will be returned with the response:
  2234  
  2235  |Name|Description|
  2236  |----|-----------|
  2237  |`Location`|The location of the upload. Clients should assume this changes after each request. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
  2238  |`Range`|Range indicating the current progress of the upload.|
  2239  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  2240  |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
  2241  
  2242  
  2243  
  2244  
  2245  ###### On Failure: Bad Request
  2246  
  2247  ```
  2248  400 Bad Request
  2249  Content-Type: application/json; charset=utf-8
  2250  
  2251  {
  2252  	"errors:" [
  2253  	    {
  2254              "code": <error code>,
  2255              "message": "<error message>",
  2256              "detail": ...
  2257          },
  2258          ...
  2259      ]
  2260  }
  2261  ```
  2262  
  2263  There was an error processing the upload and it must be restarted.
  2264  
  2265  
  2266  
  2267  The error codes that may be included in the response body are enumerated below:
  2268  
  2269  |Code|Message|Description|
  2270  -------|----|------|------------
  2271  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  2272  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  2273  | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
  2274  
  2275  
  2276  
  2277  ###### On Failure: Unauthorized
  2278  
  2279  ```
  2280  401 Unauthorized
  2281  WWW-Authenticate: <scheme> realm="<realm>", ..."
  2282  Content-Length: <length>
  2283  Content-Type: application/json; charset=utf-8
  2284  
  2285  {
  2286  	"errors:" [
  2287  	    {
  2288              "code": "UNAUTHORIZED",
  2289              "message": "access to the requested resource is not authorized",
  2290              "detail": ...
  2291          },
  2292          ...
  2293      ]
  2294  }
  2295  ```
  2296  
  2297  The client does not have access to push to the repository.
  2298  
  2299  The following headers will be returned on the response:
  2300  
  2301  |Name|Description|
  2302  |----|-----------|
  2303  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  2304  |`Content-Length`|Length of the JSON error response body.|
  2305  
  2306  
  2307  
  2308  The error codes that may be included in the response body are enumerated below:
  2309  
  2310  |Code|Message|Description|
  2311  -------|----|------|------------
  2312  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  2313  
  2314  
  2315  
  2316  ###### On Failure: Not Found
  2317  
  2318  ```
  2319  404 Not Found
  2320  Content-Type: application/json; charset=utf-8
  2321  
  2322  {
  2323  	"errors:" [
  2324  	    {
  2325              "code": <error code>,
  2326              "message": "<error message>",
  2327              "detail": ...
  2328          },
  2329          ...
  2330      ]
  2331  }
  2332  ```
  2333  
  2334  The upload is unknown to the registry. The upload must be restarted.
  2335  
  2336  
  2337  
  2338  The error codes that may be included in the response body are enumerated below:
  2339  
  2340  |Code|Message|Description|
  2341  -------|----|------|------------
  2342  | `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. |
  2343  
  2344  
  2345  
  2346  ##### Chunked upload
  2347  
  2348  ```
  2349  PATCH /v2/<name>/blobs/uploads/<uuid>
  2350  Host: <registry host>
  2351  Authorization: <scheme> <token>
  2352  Content-Range: <start of range>-<end of range, inclusive>
  2353  Content-Length: <length of chunk>
  2354  Content-Type: application/octet-stream
  2355  
  2356  <binary chunk>
  2357  ```
  2358  
  2359  Upload a chunk of data to specified upload without completing the upload. The data will be uploaded to the specified Content Range.
  2360  
  2361  
  2362  The following parameters should be specified on the request:
  2363  
  2364  |Name|Kind|Description|
  2365  |----|----|-----------|
  2366  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  2367  |`Authorization`|header|An RFC7235 compliant authorization header.|
  2368  |`Content-Range`|header|Range of bytes identifying the desired block of content represented by the body. Start must the end offset retrieved via status check plus one. Note that this is a non-standard use of the `Content-Range` header.|
  2369  |`Content-Length`|header|Length of the chunk being uploaded, corresponding the length of the request body.|
  2370  |`name`|path|Name of the target repository.|
  2371  |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
  2372  
  2373  
  2374  
  2375  
  2376  ###### On Success: Chunk Accepted
  2377  
  2378  ```
  2379  204 No Content
  2380  Location: /v2/<name>/blobs/uploads/<uuid>
  2381  Range: 0-<offset>
  2382  Content-Length: 0
  2383  Docker-Upload-UUID: <uuid>
  2384  ```
  2385  
  2386  The chunk of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.
  2387  
  2388  The following headers will be returned with the response:
  2389  
  2390  |Name|Description|
  2391  |----|-----------|
  2392  |`Location`|The location of the upload. Clients should assume this changes after each request. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
  2393  |`Range`|Range indicating the current progress of the upload.|
  2394  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  2395  |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
  2396  
  2397  
  2398  
  2399  
  2400  ###### On Failure: Bad Request
  2401  
  2402  ```
  2403  400 Bad Request
  2404  Content-Type: application/json; charset=utf-8
  2405  
  2406  {
  2407  	"errors:" [
  2408  	    {
  2409              "code": <error code>,
  2410              "message": "<error message>",
  2411              "detail": ...
  2412          },
  2413          ...
  2414      ]
  2415  }
  2416  ```
  2417  
  2418  There was an error processing the upload and it must be restarted.
  2419  
  2420  
  2421  
  2422  The error codes that may be included in the response body are enumerated below:
  2423  
  2424  |Code|Message|Description|
  2425  -------|----|------|------------
  2426  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  2427  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  2428  | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
  2429  
  2430  
  2431  
  2432  ###### On Failure: Unauthorized
  2433  
  2434  ```
  2435  401 Unauthorized
  2436  WWW-Authenticate: <scheme> realm="<realm>", ..."
  2437  Content-Length: <length>
  2438  Content-Type: application/json; charset=utf-8
  2439  
  2440  {
  2441  	"errors:" [
  2442  	    {
  2443              "code": "UNAUTHORIZED",
  2444              "message": "access to the requested resource is not authorized",
  2445              "detail": ...
  2446          },
  2447          ...
  2448      ]
  2449  }
  2450  ```
  2451  
  2452  The client does not have access to push to the repository.
  2453  
  2454  The following headers will be returned on the response:
  2455  
  2456  |Name|Description|
  2457  |----|-----------|
  2458  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  2459  |`Content-Length`|Length of the JSON error response body.|
  2460  
  2461  
  2462  
  2463  The error codes that may be included in the response body are enumerated below:
  2464  
  2465  |Code|Message|Description|
  2466  -------|----|------|------------
  2467  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  2468  
  2469  
  2470  
  2471  ###### On Failure: Not Found
  2472  
  2473  ```
  2474  404 Not Found
  2475  Content-Type: application/json; charset=utf-8
  2476  
  2477  {
  2478  	"errors:" [
  2479  	    {
  2480              "code": <error code>,
  2481              "message": "<error message>",
  2482              "detail": ...
  2483          },
  2484          ...
  2485      ]
  2486  }
  2487  ```
  2488  
  2489  The upload is unknown to the registry. The upload must be restarted.
  2490  
  2491  
  2492  
  2493  The error codes that may be included in the response body are enumerated below:
  2494  
  2495  |Code|Message|Description|
  2496  -------|----|------|------------
  2497  | `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. |
  2498  
  2499  
  2500  
  2501  ###### On Failure: Requested Range Not Satisfiable
  2502  
  2503  ```
  2504  416 Requested Range Not Satisfiable
  2505  ```
  2506  
  2507  The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid.
  2508  
  2509  
  2510  
  2511  
  2512  #### PUT Blob Upload
  2513  
  2514  Complete the upload specified by `uuid`, optionally appending the body as the final chunk.
  2515  
  2516  
  2517  
  2518  ```
  2519  PUT /v2/<name>/blobs/uploads/<uuid>?digest=<digest>
  2520  Host: <registry host>
  2521  Authorization: <scheme> <token>
  2522  Content-Length: <length of data>
  2523  Content-Type: application/octet-stream
  2524  
  2525  <binary data>
  2526  ```
  2527  
  2528  Complete the upload, providing all the data in the body, if necessary. A request without a body will just complete the upload with previously uploaded content.
  2529  
  2530  
  2531  The following parameters should be specified on the request:
  2532  
  2533  |Name|Kind|Description|
  2534  |----|----|-----------|
  2535  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  2536  |`Authorization`|header|An RFC7235 compliant authorization header.|
  2537  |`Content-Length`|header|Length of the data being uploaded, corresponding to the length of the request body. May be zero if no data is provided.|
  2538  |`name`|path|Name of the target repository.|
  2539  |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
  2540  |`digest`|query|Digest of uploaded blob.|
  2541  
  2542  
  2543  
  2544  
  2545  ###### On Success: Upload Complete
  2546  
  2547  ```
  2548  204 No Content
  2549  Location: <blob location>
  2550  Content-Range: <start of range>-<end of range, inclusive>
  2551  Content-Length: 0
  2552  Docker-Content-Digest: <digest>
  2553  ```
  2554  
  2555  The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header.
  2556  
  2557  The following headers will be returned with the response:
  2558  
  2559  |Name|Description|
  2560  |----|-----------|
  2561  |`Location`|The canonical location of the blob for retrieval|
  2562  |`Content-Range`|Range of bytes identifying the desired block of content represented by the body. Start must match the end of offset retrieved via status check. Note that this is a non-standard use of the `Content-Range` header.|
  2563  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  2564  |`Docker-Content-Digest`|Digest of the targeted content for the request.|
  2565  
  2566  
  2567  
  2568  
  2569  ###### On Failure: Bad Request
  2570  
  2571  ```
  2572  400 Bad Request
  2573  Content-Type: application/json; charset=utf-8
  2574  
  2575  {
  2576  	"errors:" [
  2577  	    {
  2578              "code": <error code>,
  2579              "message": "<error message>",
  2580              "detail": ...
  2581          },
  2582          ...
  2583      ]
  2584  }
  2585  ```
  2586  
  2587  There was an error processing the upload and it must be restarted.
  2588  
  2589  
  2590  
  2591  The error codes that may be included in the response body are enumerated below:
  2592  
  2593  |Code|Message|Description|
  2594  -------|----|------|------------
  2595  | `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
  2596  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  2597  | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
  2598  
  2599  
  2600  
  2601  ###### On Failure: Unauthorized
  2602  
  2603  ```
  2604  401 Unauthorized
  2605  WWW-Authenticate: <scheme> realm="<realm>", ..."
  2606  Content-Length: <length>
  2607  Content-Type: application/json; charset=utf-8
  2608  
  2609  {
  2610  	"errors:" [
  2611  	    {
  2612              "code": "UNAUTHORIZED",
  2613              "message": "access to the requested resource is not authorized",
  2614              "detail": ...
  2615          },
  2616          ...
  2617      ]
  2618  }
  2619  ```
  2620  
  2621  The client does not have access to push to the repository.
  2622  
  2623  The following headers will be returned on the response:
  2624  
  2625  |Name|Description|
  2626  |----|-----------|
  2627  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  2628  |`Content-Length`|Length of the JSON error response body.|
  2629  
  2630  
  2631  
  2632  The error codes that may be included in the response body are enumerated below:
  2633  
  2634  |Code|Message|Description|
  2635  -------|----|------|------------
  2636  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  2637  
  2638  
  2639  
  2640  ###### On Failure: Not Found
  2641  
  2642  ```
  2643  404 Not Found
  2644  Content-Type: application/json; charset=utf-8
  2645  
  2646  {
  2647  	"errors:" [
  2648  	    {
  2649              "code": <error code>,
  2650              "message": "<error message>",
  2651              "detail": ...
  2652          },
  2653          ...
  2654      ]
  2655  }
  2656  ```
  2657  
  2658  The upload is unknown to the registry. The upload must be restarted.
  2659  
  2660  
  2661  
  2662  The error codes that may be included in the response body are enumerated below:
  2663  
  2664  |Code|Message|Description|
  2665  -------|----|------|------------
  2666  | `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. |
  2667  
  2668  
  2669  
  2670  
  2671  #### DELETE Blob Upload
  2672  
  2673  Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout.
  2674  
  2675  
  2676  
  2677  ```
  2678  DELETE /v2/<name>/blobs/uploads/<uuid>
  2679  Host: <registry host>
  2680  Authorization: <scheme> <token>
  2681  Content-Length: 0
  2682  ```
  2683  
  2684  Cancel the upload specified by `uuid`.
  2685  
  2686  
  2687  The following parameters should be specified on the request:
  2688  
  2689  |Name|Kind|Description|
  2690  |----|----|-----------|
  2691  |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
  2692  |`Authorization`|header|An RFC7235 compliant authorization header.|
  2693  |`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.|
  2694  |`name`|path|Name of the target repository.|
  2695  |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
  2696  
  2697  
  2698  
  2699  
  2700  ###### On Success: Upload Deleted
  2701  
  2702  ```
  2703  204 No Content
  2704  Content-Length: 0
  2705  ```
  2706  
  2707  The upload has been successfully deleted.
  2708  
  2709  The following headers will be returned with the response:
  2710  
  2711  |Name|Description|
  2712  |----|-----------|
  2713  |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
  2714  
  2715  
  2716  
  2717  
  2718  ###### On Failure: Bad Request
  2719  
  2720  ```
  2721  400 Bad Request
  2722  Content-Type: application/json; charset=utf-8
  2723  
  2724  {
  2725  	"errors:" [
  2726  	    {
  2727              "code": <error code>,
  2728              "message": "<error message>",
  2729              "detail": ...
  2730          },
  2731          ...
  2732      ]
  2733  }
  2734  ```
  2735  
  2736  An error was encountered processing the delete. The client may ignore this error.
  2737  
  2738  
  2739  
  2740  The error codes that may be included in the response body are enumerated below:
  2741  
  2742  |Code|Message|Description|
  2743  -------|----|------|------------
  2744  | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
  2745  | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
  2746  
  2747  
  2748  
  2749  ###### On Failure: Unauthorized
  2750  
  2751  ```
  2752  401 Unauthorized
  2753  WWW-Authenticate: <scheme> realm="<realm>", ..."
  2754  Content-Length: <length>
  2755  Content-Type: application/json; charset=utf-8
  2756  
  2757  {
  2758  	"errors:" [
  2759  	    {
  2760              "code": "UNAUTHORIZED",
  2761              "message": "access to the requested resource is not authorized",
  2762              "detail": ...
  2763          },
  2764          ...
  2765      ]
  2766  }
  2767  ```
  2768  
  2769  The client does not have access to the repository.
  2770  
  2771  The following headers will be returned on the response:
  2772  
  2773  |Name|Description|
  2774  |----|-----------|
  2775  |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
  2776  |`Content-Length`|Length of the JSON error response body.|
  2777  
  2778  
  2779  
  2780  The error codes that may be included in the response body are enumerated below:
  2781  
  2782  |Code|Message|Description|
  2783  -------|----|------|------------
  2784  | `UNAUTHORIZED` | access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
  2785  
  2786  
  2787  
  2788  ###### On Failure: Not Found
  2789  
  2790  ```
  2791  404 Not Found
  2792  Content-Type: application/json; charset=utf-8
  2793  
  2794  {
  2795  	"errors:" [
  2796  	    {
  2797              "code": <error code>,
  2798              "message": "<error message>",
  2799              "detail": ...
  2800          },
  2801          ...
  2802      ]
  2803  }
  2804  ```
  2805  
  2806  The upload is unknown to the registry. The client may ignore this error and assume the upload has been deleted.
  2807  
  2808  
  2809  
  2810  The error codes that may be included in the response body are enumerated below:
  2811  
  2812  |Code|Message|Description|
  2813  -------|----|------|------------
  2814  | `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. |
  2815  
  2816  
  2817  
  2818  
  2819