2016-10-14 22:40:45 +00:00
---
title: "HTTP API V2"
description: "Specification for the Registry API."
2017-10-20 18:16:21 +00:00
keywords: registry, on-prem, images, tags, repository, distribution, api, advanced
2020-07-08 10:18:31 +00:00
redirect_from:
- /reference/api/registry_api/
2016-10-14 22:40:45 +00:00
---
2015-06-08 00:58:53 +00:00
2014-12-24 00:24:04 +00:00
# Docker Registry HTTP API V2
2014-12-19 05:38:20 +00:00
2014-12-24 00:24:04 +00:00
## Introduction
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
The _Docker Registry HTTP API_ is the protocol to facilitate distribution of
images to the docker engine. It interacts with instances of the docker
registry, which is a service to manage information about docker images and
enable their distribution. The specification covers the operation of version 2
of this API, known as _Docker Registry HTTP API V2_ .
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
While the V1 registry protocol is usable, there are several problems with the
architecture that have led to this new version. The main driver of this
2017-12-29 12:40:15 +00:00
specification is a set of changes to the Docker image format, covered in
2016-03-17 23:11:31 +00:00
[docker/docker#8093 ](https://github.com/docker/docker/issues/8093 ).
The new, self-contained image manifest simplifies image definition and improves
security. This specification will build on that work, leveraging new properties
of the manifest format to improve performance, reduce bandwidth usage and
decrease the likelihood of backend corruption.
2014-12-19 05:38:20 +00:00
2014-12-24 00:24:04 +00:00
For relevant details and history leading up to this specification, please see
the following issues:
2014-12-18 22:50:07 +00:00
2015-04-03 15:03:43 +00:00
- [docker/docker#8093 ](https://github.com/docker/docker/issues/8093 )
2015-02-28 03:38:38 +00:00
- [docker/docker#9015 ](https://github.com/docker/docker/issues/9015 )
- [docker/docker-registry#612 ](https://github.com/docker/docker-registry/issues/612 )
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
### Scope
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
This specification covers the URL layout and protocols of the interaction
between docker registry and docker core. This will affect the docker core
registry API and the rewrite of docker-registry. Docker registry
implementations may implement other API endpoints, but they are not covered by
this specification.
2014-12-18 22:50:07 +00:00
This includes the following features:
- Namespace-oriented URI Layout
- PUSH/PULL registry server for V2 image manifest format
- Resumable layer PUSH support
- V2 Client library implementation
2014-12-19 00:09:35 +00:00
While authentication and authorization support will influence this
specification, details of the protocol will be left to a future specification.
2014-12-24 00:24:04 +00:00
Relevant header definitions and error codes are present to provide an
indication of what a client may encounter.
#### Future
There are features that have been discussed during the process of cutting this
specification. The following is an incomplete list:
- Immutable image references
- Multiple architecture support
- Migration from v2compatibility representation
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
These may represent features that are either out of the scope of this
specification, the purview of another specification or have been deferred to a
future version.
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
### Use Cases
2014-12-19 05:38:20 +00:00
2014-12-19 00:09:35 +00:00
For the most part, the use cases of the former registry API apply to the new
2014-12-24 00:24:04 +00:00
version. Differentiating use cases are covered below.
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
#### Image Verification
A docker engine instance would like to run verified image named
"library/ubuntu", with the tag "latest". The engine contacts the registry,
requesting the manifest for "library/ubuntu:latest". An untrusted registry
returns a manifest. Before proceeding to download the individual layers, the
engine verifies the manifest's signature, ensuring that the content was
2016-02-23 21:33:38 +00:00
produced from a trusted source and no tampering has occurred. After each layer
2014-12-24 00:24:04 +00:00
is downloaded, the engine verifies the digest of the layer, ensuring that the
content matches that specified by the manifest.
#### Resumable Push
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
Company X's build servers lose connectivity to docker registry before
completing an image layer transfer. After connectivity returns, the build
server attempts to re-upload the image. The registry notifies the build server
that the upload has already been partially attempted. The build server
responds by only sending the remaining data to complete the image file.
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
#### Resumable Pull
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
Company X is having more connectivity problems but this time in their
deployment datacenter. When downloading an image, the connection is
interrupted before completion. The client keeps the partial data and uses http
`Range` requests to avoid downloading repeated data.
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
#### Layer Upload De-duplication
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
Company Y's build system creates two identical docker layers from build
processes A and B. Build process A completes uploading the layer before B.
When process B attempts to upload the layer, the registry indicates that its
not necessary because the layer is already known.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
If process A and B upload the same layer at the same time, both operations
will proceed and the first to complete will be stored in the registry (Note:
we may modify this to prevent dogpile with some locking mechanism).
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
### Changes
The V2 specification has been written to work as a living document, specifying
only what is certain and leaving what is not specified open or to future
changes. Only non-conflicting additions should be made to the API and accepted
changes should avoid preventing future changes from happening.
This section should be updated when changes are made to the specification,
2015-02-26 02:04:28 +00:00
indicating what is different. Optionally, we may start marking parts of the
specification to correspond with the versions enumerated here.
2014-12-24 00:24:04 +00:00
2015-07-23 03:09:41 +00:00
Each set of changes is given a letter corresponding to a set of modifications
that were applied to the baseline specification. These are merely for
reference and shouldn't be used outside the specification other than to
identify a set of modifications.
2014-12-24 00:24:04 +00:00
< dl >
2016-07-12 18:18:54 +00:00
< dt > l< / dt >
< dd >
< ul >
< li > Document TOOMANYREQUESTS error code.< / li >
< / ul >
< / dd >
2016-01-18 18:19:36 +00:00
< dt > k< / dt >
< dd >
< ul >
< li > Document use of Accept and Content-Type headers in manifests endpoint.< / li >
< / ul >
< / dd >
2016-01-20 20:19:25 +00:00
< dt > j< / dt >
< dd >
< ul >
< li > Add ability to mount blobs across repositories.< / li >
< / ul >
< / dd >
< dt > i< / dt >
< dd >
< ul >
< li > Clarified expected behavior response to manifest HEAD request.< / li >
< / ul >
< / dd >
< dt > h< / dt >
< dd >
< ul >
< li > All mention of tarsum removed.< / li >
< / ul >
< / dd >
< dt > g< / dt >
< dd >
< ul >
< li > Clarify behavior of pagination behavior with unspecified parameters.< / li >
< / ul >
< / dd >
2015-05-27 17:52:22 +00:00
< dt > f< / dt >
< dd >
< ul >
< li > Specify the delete API for layers and manifests.< / li >
< / ul >
< / dd >
2015-06-02 02:10:51 +00:00
2015-07-23 03:09:41 +00:00
< dt > e< / dt >
2015-06-02 02:10:51 +00:00
< dd >
< ul >
< li > Added support for listing registry contents.< / li >
< li > Added pagination to tags API.< / li >
< li > Added common approach to support pagination.< / li >
< / ul >
< / dd >
2015-07-23 03:09:41 +00:00
< dt > d< / dt >
< dd >
< ul >
< li > Allow repository name components to be one character.< / li >
< li > Clarified that single component names are allowed.< / li >
< / ul >
< / dd >
< dt > c< / dt >
< dd >
< ul >
< li > Added section covering digest format.< / li >
< li > Added more clarification that manifest cannot be deleted by tag.< / li >
< / ul >
< / dd >
< dt > b< / dt >
2015-07-10 18:00:06 +00:00
< dd >
2015-07-23 03:09:41 +00:00
< ul >
< li > Added capability of doing streaming upload to PATCH blob upload.< / li >
< li > Updated PUT blob upload to no longer take final chunk, now requires entire data or no data.< / li >
< li > Removed `416 Requested Range Not Satisfiable` response status from PUT blob upload.</ li >
< / ul >
2015-07-10 18:00:06 +00:00
< / dd >
2015-07-23 03:09:41 +00:00
< dt > a< / dt >
2015-06-05 02:57:40 +00:00
< dd >
2015-07-23 03:09:41 +00:00
< ul >
< li > Added support for immutable manifest references in manifest endpoints.< / li >
< li > Deleting a manifest by tag has been deprecated.< / li >
< li > Specified `Docker-Content-Digest` header for appropriate entities.</ li >
< li > Added error code for unsupported operations.< / li >
< / ul >
2015-06-05 02:57:40 +00:00
< / dd >
2014-12-24 00:24:04 +00:00
< / dl >
2014-12-19 05:38:20 +00:00
## Overview
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
This section covers client flows and details of the API endpoints. The URI
layout of the new API is structured to support a rich authentication and
authorization model by leveraging namespaces. All endpoints will be prefixed
by the API version and the repository name:
2014-12-18 22:50:07 +00:00
/v2/< name > /
2014-12-19 00:09:35 +00:00
For example, an API endpoint that will work with the `library/ubuntu`
repository, the URI prefix will be:
2014-12-18 22:50:07 +00:00
/v2/library/ubuntu/
2014-12-19 05:38:20 +00:00
This scheme provides rich access control over various operations and methods
using the URI prefix and http methods that can be controlled in variety of
ways.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
Classically, repository names have always been two path components where each
path component is less than 30 characters. The V2 registry API does not
enforce this. The rules for a repository name are as follows:
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
1. A repository name is broken up into _path components_ . A component of a
2015-07-10 18:00:06 +00:00
repository name must be at least one lowercase, alpha-numeric characters,
2014-12-24 00:24:04 +00:00
optionally separated by periods, dashes or underscores. More strictly, it
2015-07-10 18:00:06 +00:00
must match the regular expression `[a-z0-9]+(?:[._-][a-z0-9]+)*` .
2. If a repository name has two or more path components, they must be
separated by a forward slash ("/").
2016-10-17 05:40:33 +00:00
3. The total length of a repository name, including slashes, must be less than
2014-12-19 00:09:35 +00:00
256 characters.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
These name requirements _only_ apply to the registry API and should accept a
2014-12-19 05:38:20 +00:00
superset of what is supported by other docker ecosystem components.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
All endpoints should support aggressive http caching, compression and range
2014-12-19 05:38:20 +00:00
headers, where appropriate. The new API attempts to leverage HTTP semantics
where possible but may break from standards to implement targeted features.
2014-12-18 22:50:07 +00:00
2014-12-24 00:24:04 +00:00
For detail on individual endpoints, please see the [_Detail_ ](#detail )
section.
2014-12-18 22:50:07 +00:00
### Errors
2014-12-19 00:09:35 +00:00
Actionable failure conditions, covered in detail in their relevant sections,
2014-12-19 05:38:20 +00:00
are reported as part of 4xx responses, in a json response body. One or more
errors will be returned in the following format:
2014-12-18 22:50:07 +00:00
{
"errors:" [{
"code": < error identifier > ,
"message": < message describing condition > ,
"detail": < unstructured >
},
...
]
}
2014-12-19 00:09:35 +00:00
The `code` field will be a unique identifier, all caps with underscores by
convention. The `message` field will be a human readable string. The optional
`detail` field may contain arbitrary json data providing information the
client can use to resolve the issue.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
While the client can take action on certain error codes, the registry may add
new error codes over time. All client implementations should treat unknown
error codes as `UNKNOWN` , allowing future error codes to be added without
breaking API compatibility. For the purposes of the specification error codes
will only be added and never removed.
2014-12-18 22:50:07 +00:00
2016-03-17 23:11:31 +00:00
For a complete account of all error codes, please see the [_Errors_ ](#errors-2 )
section.
2014-12-19 05:38:20 +00:00
2014-12-18 22:50:07 +00:00
### API Version Check
2014-12-19 00:09:35 +00:00
A minimal endpoint, mounted at `/v2/` will provide version support information
based on its response statuses. The request format is as follows:
2014-12-18 22:50:07 +00:00
GET /v2/
2014-12-19 00:09:35 +00:00
If a `200 OK` response is returned, the registry implements the V2(.1)
registry API and the client may proceed safely with other V2 operations.
Optionally, the response may contain information about the supported paths in
the response body. The client should be prepared to ignore this data.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
If a `401 Unauthorized` response is returned, the client should take action
based on the contents of the "WWW-Authenticate" header and try the endpoint
again. Depending on access control setup, the client may still have to
authenticate against different resources, even if this check succeeds.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
If `404 Not Found` response status, or other unexpected status, is returned,
the client should proceed with the assumption that the registry does not
implement V2 of the API.
2014-12-18 22:50:07 +00:00
2015-05-06 22:44:24 +00:00
When a `200 OK` or `401 Unauthorized` response is returned, the
"Docker-Distribution-API-Version" header should be set to "registry/2.0".
Clients may require this header value to determine if the endpoint serves this
API. When this header is omitted, clients may fallback to an older API version.
2015-06-05 02:57:40 +00:00
### Content Digests
This API design is driven heavily by [content addressability ](http://en.wikipedia.org/wiki/Content-addressable_storage ).
The core of this design is the concept of a content addressable identifier. It
2015-07-31 12:36:43 +00:00
uniquely identifies content by taking a collision-resistant hash of the bytes.
2015-06-05 02:57:40 +00:00
Such an identifier can be independently calculated and verified by selection
of a common _algorithm_ . If such an identifier can be communicated in a secure
manner, one can retrieve the content from an insecure source, calculate it
independently and be certain that the correct content was obtained. Put simply,
the identifier is a property of the content.
To disambiguate from other concepts, we call this identifier a _digest_ . A
_digest_ is a serialized hash result, consisting of a _algorithm_ and _hex_
portion. The _algorithm_ identifies the methodology used to calculate the
digest. The _hex_ portion is the hex-encoded result of the hash.
We define a _digest_ string to match the following grammar:
2015-11-23 20:59:51 +00:00
```
digest := algorithm ":" hex
algorithm := /[A-Fa-f0-9_+.-]+/
hex := /[A-Fa-f0-9]+/
```
2015-06-05 02:57:40 +00:00
Some examples of _digests_ include the following:
digest | description |
----------------------------------------------------------------------------------|------------------------------------------------
sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b | Common sha256 based digest |
While the _algorithm_ does allow one to implement a wide variety of
algorithms, compliant implementations should use sha256. Heavy processing of
input before calculating a hash is discouraged to avoid degrading the
uniqueness of the _digest_ but some canonicalization may be performed to
ensure consistent identifiers.
Let's use a simple example in pseudo-code to demonstrate a digest calculation:
```
let C = 'a small string'
let B = sha256(C)
let D = 'sha256:' + EncodeHex(B)
let ID(C) = D
```
2015-11-23 20:59:51 +00:00
Above, we have bytestring `C` passed into a function, `SHA256` , that returns a
bytestring `B` , which is the hash of `C` . `D` gets the algorithm concatenated
with the hex encoding of `B` . We then define the identifier of `C` to `ID(C)`
as equal to `D` . A digest can be verified by independently calculating `D` and
comparing it with identifier `ID(C)` .
2015-06-05 02:57:40 +00:00
#### Digest Header
2016-03-17 23:11:31 +00:00
To provide verification of http content, any response may include a
`Docker-Content-Digest` header. This will include the digest of the target
entity returned in the response. For blobs, this is the entire blob content. For
2015-06-05 02:57:40 +00:00
manifests, this is the manifest body without the signature content, also known
as the JWS payload. Note that the commonly used canonicalization for digest
calculation may be dependent on the mediatype of the content, such as with
manifests.
The client may choose to ignore the header or may verify it to ensure content
integrity and transport security. This is most important when fetching by a
digest. To ensure security, the content should be verified against the digest
used to fetch the content. At times, the returned digest may differ from that
used to initiate a request. Such digests are considered to be from different
_domains_, meaning they have different values for _algorithm_ . In such a case,
the client may choose to verify the digests in both domains or ignore the
server's digest. To maintain security, the client _must_ always verify the
content against the _digest_ used to fetch the content.
> __IMPORTANT:__ If a _digest_ is used to fetch content, the client should use
2016-03-17 23:11:31 +00:00
> the same digest used to fetch the content to verify it. The header
> `Docker-Content-Digest` should not be trusted over the "local" digest.
2015-06-05 02:57:40 +00:00
2014-12-18 22:50:07 +00:00
### Pulling An Image
2014-12-19 00:09:35 +00:00
An "image" is a combination of a JSON manifest and individual layer files. The
process of pulling an image centers around retrieving these two components.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
The first step in pulling an image is to retrieve the manifest. For reference,
the relevant manifest fields for the registry are the following:
2014-12-18 22:50:07 +00:00
field | description |
----------|------------------------------------------------|
name | The name of the image. |
tag | The tag for this version of the image. |
2015-12-16 01:18:13 +00:00
fsLayers | A list of layer descriptors (including digest) |
2014-12-18 22:50:07 +00:00
signature | A JWS used to verify the manifest content |
2014-12-19 00:09:35 +00:00
For more information about the manifest format, please see
[docker/docker#8093 ](https://github.com/docker/docker/issues/8093 ).
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
When the manifest is in hand, the client must verify the signature to ensure
the names and layers are valid. Once confirmed, the client will then use the
2015-12-16 01:18:13 +00:00
digests to download the individual layers. Layers are stored in as blobs in
the V2 registry API, keyed by their digest.
2014-12-18 22:50:07 +00:00
#### Pulling an Image Manifest
The image manifest can be fetched with the following url:
```
2015-02-26 02:04:28 +00:00
GET /v2/< name > /manifests/< reference >
2014-12-18 22:50:07 +00:00
```
2015-02-26 02:04:28 +00:00
The `name` and `reference` parameter identify the image and are required. The
reference may include a tag or digest.
2014-12-18 22:50:07 +00:00
2016-01-18 18:19:36 +00:00
The client should include an Accept header indicating which manifest content
types it supports. For more details on the manifest formats and their content
2016-03-17 23:11:31 +00:00
types, see [manifest-v2-1.md ](manifest-v2-1.md ) and
[manifest-v2-2.md ](manifest-v2-2.md ). In a successful response, the Content-Type
header will indicate which manifest type is being returned.
2016-01-18 18:19:36 +00:00
2014-12-19 00:09:35 +00:00
A `404 Not Found` response will be returned if the image is unknown to the
registry. If the image exists and the response is successful, the image
2016-03-17 23:11:31 +00:00
manifest will be returned, with the following format (see
[docker/docker#8093 ](https://github.com/docker/docker/issues/8093 ) for details):
2014-12-18 22:50:07 +00:00
{
"name": < name > ,
"tag": < tag > ,
"fsLayers": [
{
2015-12-16 01:18:13 +00:00
"blobSum": < digest >
2014-12-18 22:50:07 +00:00
},
...
]
],
"history": < v1 images > ,
"signature": < JWS >
}
2014-12-19 00:09:35 +00:00
The client should verify the returned manifest signature for authenticity
before fetching layers.
2014-12-18 22:50:07 +00:00
2015-08-21 04:50:15 +00:00
##### Existing Manifests
The image manifest can be checked for existence with the following url:
```
HEAD /v2/< name > /manifests/< reference >
```
The `name` and `reference` parameter identify the image and are required. The
reference may include a tag or digest.
A `404 Not Found` response will be returned if the image is unknown to the
registry. If the image exists and the response is successful the response will
be as follows:
```
200 OK
Content-Length: < length of manifest >
Docker-Content-Digest: < digest >
```
2014-12-18 22:50:07 +00:00
#### Pulling a Layer
2015-12-16 01:18:13 +00:00
Layers are stored in the blob portion of the registry, keyed by digest.
2014-12-19 00:09:35 +00:00
Pulling a layer is carried out by a standard http request. The URL is as
follows:
2014-12-18 22:50:07 +00:00
2015-12-16 01:18:13 +00:00
GET /v2/< name > /blobs/< digest >
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
Access to a layer will be gated by the `name` of the repository but is
2015-12-16 01:18:13 +00:00
identified uniquely in the registry by `digest` .
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
This endpoint may issue a 307 (302 for < HTTP 1 . 1 ) redirect to another service
for downloading the layer and clients should be prepared to handle redirects.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
This endpoint should support aggressive HTTP caching for image layers. Support
for Etags, modification dates and other cache control headers should be
included. To allow for incremental downloads, `Range` requests should be
supported, as well.
2014-12-18 22:50:07 +00:00
### Pushing An Image
2014-12-19 00:09:35 +00:00
Pushing an image works in the opposite order as a pull. After assembling the
image manifest, the client must first push the individual layers. When the
layers are fully pushed into the registry, the client should upload the signed
manifest.
2014-12-18 22:50:07 +00:00
The details of each step of the process are covered in the following sections.
#### Pushing a Layer
2014-12-19 00:09:35 +00:00
All layer uploads use two steps to manage the upload process. The first step
starts the upload in the registry service, returning a url to carry out the
second step. The second step uses the upload url to transfer the actual data.
Uploads are started with a POST request which returns a url that can be used
2014-12-18 22:50:07 +00:00
to push data and check upload status.
2014-12-19 00:09:35 +00:00
The `Location` header will be used to communicate the upload location after
each request. While it won't change in the this specification, clients should
use the most recent value returned by the API.
2014-12-18 22:50:07 +00:00
##### Starting An Upload
To begin the process, a POST request should be issued in the following format:
```
POST /v2/< name > /blobs/uploads/
```
2014-12-19 00:09:35 +00:00
The parameters of this request are the image namespace under which the layer
will be linked. Responses to this request are covered below.
2014-12-18 22:50:07 +00:00
##### Existing Layers
2014-12-19 00:09:35 +00:00
The existence of a layer can be checked via a `HEAD` request to the blob store
API. The request should be formatted as follows:
2014-12-18 22:50:07 +00:00
```
HEAD /v2/< name > /blobs/< digest >
```
2015-12-16 01:18:13 +00:00
If the layer with the digest specified in `digest` is available, a 200 OK
2014-12-19 00:09:35 +00:00
response will be received, with no actual body content (this is according to
http specification). The response will look as follows:
2014-12-18 22:50:07 +00:00
```
200 OK
Content-Length: < length of blob >
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2014-12-18 22:50:07 +00:00
```
2014-12-19 00:09:35 +00:00
When this response is received, the client can assume that the layer is
already available in the registry under the given name and should take no
further action to upload the layer. Note that the binary digests may differ
2015-12-16 01:18:13 +00:00
for the existing registry layer, but the digests will be guaranteed to match.
2014-12-18 22:50:07 +00:00
##### Uploading the Layer
2014-12-19 00:09:35 +00:00
If the POST request is successful, a `202 Accepted` response will be returned
with the upload URL in the `Location` header:
2014-12-18 22:50:07 +00:00
```
202 Accepted
Location: /v2/< name > /blobs/uploads/< uuid >
Range: bytes=0-< offset >
Content-Length: 0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-18 22:50:07 +00:00
```
2014-12-19 00:09:35 +00:00
The rest of the upload process can be carried out with the returned url,
called the "Upload URL" from the `Location` header. All responses to the
upload url, whether sending data or getting status, will be in this format.
Though the URI format (`/v2/< name > /blobs/uploads/< uuid > `) for the `Location`
header is specified, clients should treat it as an opaque url and should never
2016-03-17 23:11:31 +00:00
try to assemble it. While the `uuid` parameter may be an actual UUID, this
2014-12-19 00:09:35 +00:00
proposal imposes no constraints on the format and clients should never impose
any.
2014-12-18 22:50:07 +00:00
2015-02-27 00:43:47 +00:00
If clients need to correlate local upload state with remote upload state, the
contents of the `Docker-Upload-UUID` header should be used. Such an id can be
used to key the last used location header when implementing resumable uploads.
2014-12-18 22:50:07 +00:00
##### Upload Progress
2014-12-19 00:09:35 +00:00
The progress and chunk coordination of the upload process will be coordinated
through the `Range` header. While this is a non-standard use of the `Range`
2015-02-28 03:02:47 +00:00
header, there are examples of [similar approaches ](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol ) in APIs with heavy use.
2014-12-19 00:09:35 +00:00
For an upload that just started, for an example with a 1000 byte layer file,
the `Range` header would be as follows:
2014-12-18 22:50:07 +00:00
```
Range: bytes=0-0
```
To get the status of an upload, issue a GET request to the upload URL:
```
GET /v2/< name > /blobs/uploads/< uuid >
Host: < registry host >
```
The response will be similar to the above, except will return 204 status:
```
204 No Content
Location: /v2/< name > /blobs/uploads/< uuid >
Range: bytes=0-< offset >
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-18 22:50:07 +00:00
```
2014-12-19 00:09:35 +00:00
Note that the HTTP `Range` header byte ranges are inclusive and that will be
honored, even in non-standard use cases.
2014-12-18 22:50:07 +00:00
##### Monolithic Upload
2014-12-19 00:09:35 +00:00
A monolithic upload is simply a chunked upload with a single chunk and may be
favored by clients that would like to avoided the complexity of chunking. To
carry out a "monolithic" upload, one can simply put the entire content blob to
the provided URL:
2014-12-18 22:50:07 +00:00
```
2015-12-16 01:18:13 +00:00
PUT /v2/< name > /blobs/uploads/< uuid > ?digest=< digest >
2014-12-18 22:50:07 +00:00
Content-Length: < size of layer >
Content-Type: application/octet-stream
< Layer Binary Data >
```
2014-12-19 00:09:35 +00:00
The "digest" parameter must be included with the PUT request. Please see the
2016-03-17 23:11:31 +00:00
[_Completed Upload_ ](#completed-upload ) section for details on the parameters
and expected responses.
2014-12-18 22:50:07 +00:00
##### Chunked Upload
2014-12-19 00:09:35 +00:00
To carry out an upload of a chunk, the client can specify a range header and
only include that part of the layer file:
2014-12-18 22:50:07 +00:00
```
PATCH /v2/< name > /blobs/uploads/< uuid >
Content-Length: < size of chunk >
Content-Range: < start of range > -< end of range >
Content-Type: application/octet-stream
< Layer Chunk Binary Data >
```
2014-12-19 00:09:35 +00:00
There is no enforcement on layer chunk splits other than that the server must
receive them in order. The server may enforce a minimum chunk size. If the
server cannot accept the chunk, a `416 Requested Range Not Satisfiable`
response will be returned and will include a `Range` header indicating the
current status:
2014-12-18 22:50:07 +00:00
```
416 Requested Range Not Satisfiable
Location: /v2/< name > /blobs/uploads/< uuid >
Range: 0-< last valid range >
Content-Length: 0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-18 22:50:07 +00:00
```
2014-12-19 00:09:35 +00:00
If this response is received, the client should resume from the "last valid
range" and upload the subsequent chunk. A 416 will be returned under the
following conditions:
2014-12-18 22:50:07 +00:00
- Invalid Content-Range header format
2014-12-19 05:38:20 +00:00
- Out of order chunk: the range of the next chunk must start immediately after
the "last valid range" from the previous response.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
When a chunk is accepted as part of the upload, a `202 Accepted` response will
be returned, including a `Range` header with the current upload status:
2014-12-18 22:50:07 +00:00
```
202 Accepted
Location: /v2/< name > /blobs/uploads/< uuid >
Range: bytes=0-< offset >
Content-Length: 0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-18 22:50:07 +00:00
```
##### Completed Upload
2014-12-19 00:09:35 +00:00
For an upload to be considered complete, the client must submit a `PUT`
request on the upload endpoint with a digest parameter. If it is not provided,
2015-03-19 20:13:53 +00:00
the upload will not be considered complete. The format for the final chunk
2014-12-19 00:09:35 +00:00
will be as follows:
2014-12-18 22:50:07 +00:00
```
2017-07-18 21:48:55 +00:00
PUT /v2/< name > /blobs/uploads/< uuid > ?digest=< digest >
2014-12-18 22:50:07 +00:00
Content-Length: < size of chunk >
Content-Range: < start of range > -< end of range >
Content-Type: application/octet-stream
< Last Layer Chunk Binary Data >
```
2014-12-19 00:09:35 +00:00
Optionally, if all chunks have already been uploaded, a `PUT` request with a
2017-07-28 17:13:32 +00:00
`digest` parameter and zero-length body may be sent to complete and validate
2014-12-19 00:09:35 +00:00
the upload. Multiple "digest" parameters may be provided with different
digests. The server may verify none or all of them but _must_ notify the
client if the content is rejected.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
When the last chunk is received and the layer has been validated, the client
will receive a `201 Created` response:
2014-12-18 22:50:07 +00:00
```
201 Created
2015-12-16 01:18:13 +00:00
Location: /v2/< name > /blobs/< digest >
2014-12-18 22:50:07 +00:00
Content-Length: 0
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2014-12-18 22:50:07 +00:00
```
2014-12-19 00:09:35 +00:00
The `Location` header will contain the registry URL to access the accepted
2015-02-26 02:04:28 +00:00
layer file. The `Docker-Content-Digest` header returns the canonical digest of
the uploaded blob which may differ from the provided digest. Most clients may
ignore the value but if it is used, the client should verify the value against
the uploaded blob data.
2014-12-18 22:50:07 +00:00
###### Digest Parameter
2014-12-19 00:09:35 +00:00
The "digest" parameter is designed as an opaque parameter to support
2016-06-02 05:31:13 +00:00
verification of a successful transfer. For example, an HTTP URI parameter
2015-12-16 01:18:13 +00:00
might be as follows:
2014-12-18 22:50:07 +00:00
```
sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b
```
2015-12-16 01:18:13 +00:00
Given this parameter, the registry will verify that the provided content does
match this digest.
2014-12-18 22:50:07 +00:00
##### Canceling an Upload
2014-12-19 00:09:35 +00:00
An upload can be cancelled by issuing a DELETE request to the upload endpoint.
The format will be as follows:
2014-12-18 22:50:07 +00:00
```
DELETE /v2/< name > /blobs/uploads/< uuid >
```
2014-12-19 00:09:35 +00:00
After this request is issued, the upload uuid will no longer be valid and the
registry server will dump all intermediate data. While uploads will time out
if not completed, clients should issue this request if they encounter a fatal
error but still have the ability to issue an http request.
2014-12-18 22:50:07 +00:00
2015-12-15 02:34:18 +00:00
##### Cross Repository Blob Mount
A blob may be mounted from another repository that the client has read access
to, removing the need to upload a blob already known to the registry. To issue
a blob mount instead of an upload, a POST request should be issued in the
following format:
```
POST /v2/< name > /blobs/uploads/?mount=< digest > & from=< repository name >
Content-Length: 0
```
If the blob is successfully mounted, the client will receive a `201 Created`
response:
```
201 Created
Location: /v2/< name > /blobs/< digest >
Content-Length: 0
Docker-Content-Digest: < digest >
```
The `Location` header will contain the registry URL to access the accepted
layer file. The `Docker-Content-Digest` header returns the canonical digest of
the uploaded blob which may differ from the provided digest. Most clients may
ignore the value but if it is used, the client should verify the value against
the uploaded blob data.
2016-01-13 19:44:42 +00:00
If a mount fails due to invalid repository or digest arguments, the registry
will fall back to the standard upload behavior and return a `202 Accepted` with
the upload URL in the `Location` header:
```
202 Accepted
Location: /v2/< name > /blobs/uploads/< uuid >
Range: bytes=0-< offset >
Content-Length: 0
Docker-Upload-UUID: < uuid >
```
This behavior is consistent with older versions of the registry, which do not
recognize the repository mount query parameters.
Note: a client may issue a HEAD request to check existence of a blob in a source
repository to distinguish between the registry not supporting blob mounts and
the blob not existing in the expected repository.
2014-12-18 22:50:07 +00:00
##### Errors
2014-12-19 00:09:35 +00:00
If an 502, 503 or 504 error is received, the client should assume that the
download can proceed due to a temporary condition, honoring the appropriate
retry mechanism. Other 5xx errors should be treated as terminal.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
If there is a problem with the upload, a 4xx error will be returned indicating
the problem. After receiving a 4xx response (except 416, as called out above),
the upload will be considered failed and the client should take appropriate
action.
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
Note that the upload url will not be available forever. If the upload uuid is
unknown to the registry, a `404 Not Found` response will be returned and the
client must restart the upload process.
2014-12-18 22:50:07 +00:00
2016-09-22 04:01:13 +00:00
#### Deleting a Layer
2015-05-27 17:52:22 +00:00
A layer may be deleted from the registry via its `name` and `digest` . A
delete may be issued with the following request format:
DELETE /v2/< name > /blobs/< digest >
2015-08-03 18:59:19 +00:00
If the blob exists and has been successfully deleted, the following response
will be issued:
2015-05-27 17:52:22 +00:00
202 Accepted
Content-Length: None
If the blob had already been deleted or did not exist, a `404 Not Found`
response will be issued instead.
2015-08-03 18:59:19 +00:00
If a layer is deleted which is referenced by a manifest in the registry,
then the complete images will not be resolvable.
2015-05-27 17:52:22 +00:00
2014-12-18 22:50:07 +00:00
#### Pushing an Image Manifest
2014-12-19 00:09:35 +00:00
Once all of the layers for an image are uploaded, the client can upload the
2014-12-19 05:38:20 +00:00
image manifest. An image can be pushed using the following request format:
2014-12-18 22:50:07 +00:00
2015-02-26 02:04:28 +00:00
PUT /v2/< name > /manifests/< reference >
2016-01-18 18:19:36 +00:00
Content-Type: < manifest media type >
2014-12-18 22:50:07 +00:00
{
"name": < name > ,
"tag": < tag > ,
"fsLayers": [
{
2015-12-16 01:18:13 +00:00
"blobSum": < digest >
2014-12-18 22:50:07 +00:00
},
...
]
],
"history": < v1 images > ,
"signature": < JWS > ,
...
}
2016-03-17 23:11:31 +00:00
The `name` and `reference` fields of the response body must match those
specified in the URL. The `reference` field may be a "tag" or a "digest". The
content type should match the type of the manifest being uploaded, as specified
in [manifest-v2-1.md ](manifest-v2-1.md ) and [manifest-v2-2.md ](manifest-v2-2.md ).
2014-12-18 22:50:07 +00:00
2014-12-19 00:09:35 +00:00
If there is a problem with pushing the manifest, a relevant 4xx response will
2016-03-17 23:11:31 +00:00
be returned with a JSON error message. Please see the
[_PUT Manifest_ ](#put-manifest ) section for details on possible error codes that
may be returned.
2014-12-19 05:38:20 +00:00
If one or more layers are unknown to the registry, `BLOB_UNKNOWN` errors are
returned. The `detail` field of the error response will have a `digest` field
2015-12-16 01:18:13 +00:00
identifying the missing blob. An error is returned for each unknown blob. The
response format is as follows:
2014-12-18 22:50:07 +00:00
{
"errors:" [{
2014-12-19 05:38:20 +00:00
"code": "BLOB_UNKNOWN",
"message": "blob unknown to registry",
2014-12-18 22:50:07 +00:00
"detail": {
2015-12-16 01:18:13 +00:00
"digest": < digest >
2014-12-18 22:50:07 +00:00
}
},
...
]
}
2015-06-03 03:16:59 +00:00
### Listing Repositories
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
Images are stored in collections, known as a _repository_ , which is keyed by a
`name` , as seen throughout the API specification. A registry instance may
contain several repositories. The list of available repositories is made
available through the _catalog_ .
2015-06-02 02:10:51 +00:00
2015-07-31 12:36:43 +00:00
The catalog for a given registry can be retrieved with the following request:
2014-12-18 22:50:07 +00:00
2015-06-03 03:16:59 +00:00
```
GET /v2/_catalog
```
2014-12-18 22:50:07 +00:00
The response will be in the following format:
2015-06-03 03:16:59 +00:00
```
200 OK
Content-Type: application/json
2014-12-18 22:50:07 +00:00
2015-06-03 03:16:59 +00:00
{
"repositories": [
< name > ,
...
]
}
```
2014-12-18 22:50:07 +00:00
2015-06-03 03:16:59 +00:00
Note that the contents of the response are specific to the registry
implementation. Some registries may opt to provide a full catalog output,
limit it based on the user's access level or omit upstream results, if
providing mirroring functionality. Subsequently, the presence of a repository
in the catalog listing only means that the registry *may* provide access to
the repository at the time of the request. Conversely, a missing entry does
*not* mean that the registry does not have the repository. More succinctly,
the presence of a repository only guarantees that it is there but not that it
is _not_ there.
For registries with a large number of repositories, this response may be quite
2015-12-03 01:26:52 +00:00
large. If such a response is expected, one should use pagination. A registry
may also limit the amount of responses returned even if pagination was not
explicitly requested. In this case the `Link` header will be returned along
with the results, and subsequent results can be obtained by following the link
as if pagination had been initially requested.
2016-03-17 23:11:31 +00:00
For details of the `Link` header, please see the [_Pagination_ ](#pagination )
section.
2015-06-02 02:10:51 +00:00
#### Pagination
2015-06-03 03:16:59 +00:00
Paginated catalog results can be retrieved by adding an `n` parameter to the
request URL, declaring that the response should be limited to `n` results.
Starting a paginated flow begins as follows:
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
GET /v2/_catalog?n=< integer >
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
The above specifies that a catalog response should be returned, from the start of
2015-06-02 02:10:51 +00:00
the result set, ordered lexically, limiting the number of results to `n` . The
response to such a request would look as follows:
```
200 OK
Content-Type: application/json
2015-06-03 03:16:59 +00:00
Link: < < url > ?n=< n from the request > & last=< last repository in response > >; rel="next"
2015-06-02 02:10:51 +00:00
{
2015-06-03 03:16:59 +00:00
"repositories": [
< name > ,
2015-06-02 02:10:51 +00:00
...
]
}
```
2015-06-03 03:16:59 +00:00
The above includes the _first_ `n` entries from the result set. To get the
_next_ `n` entries, one can create a URL where the argument `last` has the
value from `repositories[len(repositories)-1]` . If there are indeed more
results, the URL for the next block is encoded in an
[RFC5988 ](https://tools.ietf.org/html/rfc5988 ) `Link` header, as a "next"
relation. The presence of the `Link` header communicates to the client that
the entire result set has not been returned and another request must be
issued. If the header is not present, the client can assume that all results
2016-02-23 21:33:38 +00:00
have been received.
2015-06-03 03:16:59 +00:00
> __NOTE:__ In the request template above, note that the brackets
> are required. For example, if the url is
> `http://example.com/v2/_catalog?n=20&last=b`, the value of the header would
> be `<http://example.com/v2/_catalog?n=20&last=b>; rel="next"`. Please see
> [RFC5988](https://tools.ietf.org/html/rfc5988) for details.
Compliant client implementations should always use the `Link` header
value when proceeding through results linearly. The client may construct URLs
to skip forward in the catalog.
2015-06-02 02:10:51 +00:00
To get the next result set, a client would issue the request as follows, using
2015-06-03 03:16:59 +00:00
the URL encoded in the described `Link` header:
2015-06-02 02:10:51 +00:00
```
2015-07-31 12:36:43 +00:00
GET /v2/_catalog?n=< n from the request > & last=< last repository value from previous response >
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
The above process should then be repeated until the `Link` header is no longer
set.
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
The catalog result set is represented abstractly as a lexically sorted list,
where the position in that list can be specified by the query term `last` . The
entries in the response start _after_ the term specified by `last` , up to `n`
entries.
The behavior of `last` is quite simple when demonstrated with an example. Let
us say the registry has the following repositories:
2015-06-02 02:10:51 +00:00
```
a
b
c
d
```
If the value of `n` is 2, _a_ and _b_ will be returned on the first response.
2015-06-03 03:16:59 +00:00
The `Link` header returned on the response will have `n` set to 2 and last set
to _b_ :
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
Link: < < url > ?n=2&last=b>; rel="next"
2015-06-02 02:10:51 +00:00
```
2016-03-17 23:11:31 +00:00
The client can then issue the request with the above value from the `Link`
header, receiving the values _c_ and _d_ . Note that `n` may change on the second
to last response or be fully omitted, depending on the server implementation.
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
### Listing Image Tags
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
It may be necessary to list all of the tags under a given repository. The tags
for an image repository can be retrieved with the following request:
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
GET /v2/< name > /tags/list
2015-06-02 02:10:51 +00:00
The response will be in the following format:
2015-06-03 03:16:59 +00:00
200 OK
Content-Type: application/json
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
{
"name": < name > ,
"tags": [
< tag > ,
...
]
}
2015-06-02 02:10:51 +00:00
2015-06-03 03:16:59 +00:00
For repositories with a large number of tags, this response may be quite
2015-06-02 02:10:51 +00:00
large. If such a response is expected, one should use the pagination.
#### Pagination
2015-06-03 03:16:59 +00:00
Paginated tag results can be retrieved by adding the appropriate parameters to
the request URL described above. The behavior of tag pagination is identical
to that specified for catalog pagination. We cover a simple flow to highlight
any differences.
2015-06-02 02:10:51 +00:00
Starting a paginated flow may begin as follows:
```
2015-06-03 03:16:59 +00:00
GET /v2/< name > /tags/list?n=< integer >
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
The above specifies that a tags response should be returned, from the start of
2015-06-02 02:10:51 +00:00
the result set, ordered lexically, limiting the number of results to `n` . The
response to such a request would look as follows:
```
200 OK
Content-Type: application/json
2015-06-03 03:16:59 +00:00
Link: < < url > ?n=< n from the request > & last=< last tag value from previous response > >; rel="next"
2015-06-02 02:10:51 +00:00
{
2015-06-03 03:16:59 +00:00
"name": < name > ,
"tags": [
< tag > ,
2015-06-02 02:10:51 +00:00
...
]
}
```
To get the next result set, a client would issue the request as follows, using
2015-06-03 03:16:59 +00:00
the value encoded in the [RFC5988 ](https://tools.ietf.org/html/rfc5988 ) `Link`
header:
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
GET /v2/< name > /tags/list?n=< n from the request > & last=< last tag value from previous response >
2015-06-02 02:10:51 +00:00
```
2015-06-03 03:16:59 +00:00
The above process should then be repeated until the `Link` header is no longer
set in the response. The behavior of the `last` parameter, the provided
response result, lexical ordering and encoding of the `Link` header are
identical to that of catalog pagination.
2014-12-18 22:50:07 +00:00
### Deleting an Image
2015-02-26 02:04:28 +00:00
An image may be deleted from the registry via its `name` and `reference` . A
delete may be issued with the following request format:
2014-12-18 22:50:07 +00:00
2015-02-26 02:04:28 +00:00
DELETE /v2/< name > /manifests/< reference >
2014-12-18 22:50:07 +00:00
2015-02-26 02:04:28 +00:00
For deletes, `reference` *must* be a digest or the delete will fail. If the
image exists and has been successfully deleted, the following response will be
issued:
2014-12-18 22:50:07 +00:00
202 Accepted
Content-Length: None
2014-12-19 00:09:35 +00:00
If the image had already been deleted or did not exist, a `404 Not Found`
response will be issued instead.
2014-12-18 22:50:07 +00:00
2016-03-30 17:52:43 +00:00
> **Note** When deleting a manifest from a registry version 2.3 or later, the
> following header must be used when `HEAD` or `GET`-ing the manifest to obtain
> the correct digest to delete:
Accept: application/vnd.docker.distribution.manifest.v2+json
> for more details, see: [compatibility.md](../compatibility.md#content-addressable-storage-cas)
2014-12-19 05:38:20 +00:00
## Detail
> **Note**: This section is still under construction. For the purposes of
> implementation, if any details below differ from the described request flows
> above, the section below should be corrected. When they match, this note
> should be removed.
The behavior of the endpoints are covered in detail in this section, organized
by route and entity. All aspects of the request and responses are covered,
including headers, parameters and body formats. Examples of requests and their
corresponding responses, with success and failure, are enumerated.
> **Note**: The sections on endpoint detail are arranged with an example
> request, a description of the request, followed by information about that
> request.
A list of methods and URIs are covered in the table below:
|Method|Path|Entity|Description|
2015-06-26 08:34:48 +00:00
|------|----|------|-----------|
2014-12-19 05:38:20 +00:00
| GET | `/v2/` | Base | Check that the endpoint implements Docker Registry API V2. |
| GET | `/v2/<name>/tags/list` | Tags | Fetch the tags under the repository identified by `name` . |
2015-12-15 02:34:18 +00:00
| GET | `/v2/<name>/manifests/<reference>` | Manifest | Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data. |
2015-02-26 02:04:28 +00:00
| PUT | `/v2/<name>/manifests/<reference>` | Manifest | Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest. |
2015-06-05 01:59:08 +00:00
| DELETE | `/v2/<name>/manifests/<reference>` | Manifest | Delete the manifest identified by `name` and `reference` . Note that a manifest can _only_ be deleted by `digest` . |
2014-12-31 04:16:05 +00:00
| 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. |
2015-08-03 18:59:19 +00:00
| DELETE | `/v2/<name>/blobs/<digest>` | Blob | Delete the blob identified by `name` and `digest` |
2015-07-31 12:36:43 +00:00
| POST | `/v2/<name>/blobs/uploads/` | Initiate 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. |
2014-12-19 05:38:20 +00:00
| 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. |
| PATCH | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Upload a chunk of data for the specified upload. |
| PUT | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Complete the upload specified by `uuid` , optionally appending the body as the final chunk. |
| 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. |
2015-06-02 02:10:51 +00:00
| GET | `/v2/_catalog` | Catalog | Retrieve a sorted, json list of repositories available in the registry. |
2014-12-19 05:38:20 +00:00
The detail for each endpoint is covered in the following sections.
### Errors
The error codes encountered via the API are enumerated in the following table:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-06-03 13:52:39 +00:00
`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.
`BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed.
`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.
2014-12-19 05:38:20 +00:00
`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.
2015-06-03 13:52:39 +00:00
`MANIFEST_BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a manifest blob is unknown to the registry.
2014-12-19 05:38:20 +00:00
`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.
2015-06-03 13:52:39 +00:00
`MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository.
2014-12-19 05:38:20 +00:00
`MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned.
2015-06-03 13:52:39 +00:00
`NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation.
`NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry.
`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.
`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.
2015-09-28 17:41:18 +00:00
`UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate.
`DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource.
2015-06-03 13:52:39 +00:00
`UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters.
2014-12-19 05:38:20 +00:00
### Base
2015-09-28 17:41:18 +00:00
Base V2 API route. Typically, this can be used for lightweight version checks and to validate registry authentication.
2014-12-19 05:38:20 +00:00
#### GET Base
Check that the endpoint implements Docker Registry API V2.
```
GET /v2/
2014-12-31 04:16:05 +00:00
Host: < registry host >
2014-12-19 05:38:20 +00:00
Authorization: < scheme > < token >
```
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
###### On Success: OK
```
200 OK
```
The API implements V2 protocol and is accessible.
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
```
The registry does not implement the V2 API.
###### On Failure: Authentication Required
2014-12-19 05:38:20 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-19 05:38:20 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-19 05:38:20 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-19 05:38:20 +00:00
### Tags
Retrieve information about tags.
#### GET Tags
Fetch the tags under the repository identified by `name` .
2015-07-23 03:00:28 +00:00
##### Tags
2014-12-19 05:38:20 +00:00
```
GET /v2/< name > /tags/list
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
2014-12-19 05:38:20 +00:00
```
2015-07-23 03:00:28 +00:00
Return all tags for the repository
2014-12-19 05:38:20 +00:00
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
###### On Success: OK
```
200 OK
2014-12-31 04:16:05 +00:00
Content-Length: < length >
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
{
"name": < name > ,
"tags": [
< tag > ,
...
]
}
```
A list of tags for the named repository.
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client is not authenticated.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
###### On Failure: No Such Repository Error
2014-12-19 05:38:20 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
The repository is not known to the registry.
2015-09-28 17:41:18 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-31 04:16:05 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
403 Forbidden
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-19 05:38:20 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-07-23 03:00:28 +00:00
##### Tags Paginated
2014-12-19 05:38:20 +00:00
2015-06-02 02:10:51 +00:00
```
2015-07-25 02:00:25 +00:00
GET /v2/< name > /tags/list?n=< integer > & last=< integer >
2015-06-02 02:10:51 +00:00
```
Return a portion of the tags for the specified repository.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
|`name`|path|Name of the target repository.|
|`n`|query|Limit the number of entries in each response. It not present, all entries will be returned.|
|`last`|query|Result set will include values lexically after last.|
###### On Success: OK
```
200 OK
Content-Length: < length >
2015-07-23 03:00:28 +00:00
Link: < < url > ?n=< last n value > & last=< last entry from response > >; rel="next"
2015-06-02 02:10:51 +00:00
Content-Type: application/json; charset=utf-8
{
"name": < name > ,
"tags": [
< tag > ,
...
],
}
```
A list of tags for the named repository.
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2015-06-03 03:16:59 +00:00
|`Link`|RFC5988 compliant rel='next' with URL to next result set, if available|
2015-06-02 02:10:51 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client is not authenticated.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
###### On Failure: No Such Repository Error
2015-07-23 03:00:28 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2015-07-23 03:00:28 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The repository is not known to the registry.
2015-09-28 17:41:18 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2015-07-23 03:00:28 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
2015-07-23 03:00:28 +00:00
```
2015-09-28 17:41:18 +00:00
403 Forbidden
Content-Length: < length >
2015-07-23 03:00:28 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2015-07-23 03:00:28 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2015-07-23 03:00:28 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-07-23 03:00:28 +00:00
2014-12-19 05:38:20 +00:00
### Manifest
2015-08-03 18:59:19 +00:00
Create, update, delete and retrieve manifests.
2014-12-19 05:38:20 +00:00
#### GET Manifest
2015-12-15 02:34:18 +00:00
Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data.
2014-12-19 05:38:20 +00:00
```
2015-02-26 02:04:28 +00:00
GET /v2/< name > /manifests/< reference >
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
2014-12-19 05:38:20 +00:00
```
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
2015-06-01 15:14:03 +00:00
|`reference`|path|Tag or digest of the target manifest.|
2014-12-19 05:38:20 +00:00
###### On Success: OK
```
200 OK
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2016-01-18 18:19:36 +00:00
Content-Type: < media type of manifest >
2014-12-19 05:38:20 +00:00
{
"name": < name > ,
"tag": < tag > ,
"fsLayers": [
{
2015-05-02 00:13:11 +00:00
"blobSum": "< digest > "
2014-12-19 05:38:20 +00:00
},
...
]
],
"history": < v1 images > ,
"signature": < JWS >
}
```
2015-07-31 12:36:43 +00:00
The manifest identified by `name` and `reference` . The contents can be used to identify and resolve resources required to run the specified image.
2014-12-31 04:16:05 +00:00
2015-02-26 02:04:28 +00:00
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Docker-Content-Digest`|Digest of the targeted content for the request.|
2014-12-31 04:16:05 +00:00
2014-12-19 05:38:20 +00:00
###### On Failure: Bad Request
```
400 Bad Request
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
{
2014-12-31 04:16:05 +00:00
"errors:" [
{
2014-12-19 05:38:20 +00:00
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-02-26 02:04:28 +00:00
The name or reference was invalid.
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-19 05:38:20 +00:00
| `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. |
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
2015-09-28 17:41:18 +00:00
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-19 05:38:20 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
{
2014-12-31 04:16:05 +00:00
"errors:" [
{
2014-12-19 05:38:20 +00:00
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-19 05:38:20 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-19 05:38:20 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-19 05:38:20 +00:00
#### PUT Manifest
2015-02-26 02:04:28 +00:00
Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest.
2014-12-19 05:38:20 +00:00
```
2015-02-26 02:04:28 +00:00
PUT /v2/< name > /manifests/< reference >
2014-12-31 04:16:05 +00:00
Host: < registry host >
2014-12-19 05:38:20 +00:00
Authorization: < scheme > < token >
2016-01-18 18:19:36 +00:00
Content-Type: < media type of manifest >
2014-12-19 05:38:20 +00:00
{
"name": < name > ,
"tag": < tag > ,
"fsLayers": [
{
2015-05-02 00:13:11 +00:00
"blobSum": "< digest > "
2014-12-19 05:38:20 +00:00
},
...
]
],
"history": < v1 images > ,
"signature": < JWS >
}
```
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
2015-06-01 15:14:03 +00:00
|`reference`|path|Tag or digest of the target manifest.|
2014-12-19 05:38:20 +00:00
2015-07-24 17:42:02 +00:00
###### On Success: Created
2014-12-19 05:38:20 +00:00
```
2015-07-24 17:42:02 +00:00
201 Created
2014-12-31 04:16:05 +00:00
Location: < url >
Content-Length: 0
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
The manifest has been accepted by the registry and is stored under the specified `name` and `tag` .
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Location`|The canonical location url of the uploaded manifest.|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
2015-02-26 02:04:28 +00:00
|`Docker-Content-Digest`|Digest of the targeted content for the request.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Failure: Invalid Manifest
2014-12-19 05:38:20 +00:00
```
400 Bad Request
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2014-12-19 05:38:20 +00:00
2015-01-02 19:39:13 +00:00
The received manifest was invalid in some way, as described by the error codes. The client should resolve the issue and retry the request.
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-19 05:38:20 +00:00
| `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. |
| `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. |
| `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned. |
| `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. |
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
2015-09-28 17:41:18 +00:00
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
404 Not Found
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
{
2015-09-28 17:41:18 +00:00
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
2014-12-19 05:38:20 +00:00
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
403 Forbidden
2014-12-31 04:16:05 +00:00
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client does not have required access to the repository.
2014-12-19 05:38:20 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-09-28 17:41:18 +00:00
###### On Failure: Missing Layer(s)
```
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [{
"code": "BLOB_UNKNOWN",
"message": "blob unknown to registry",
"detail": {
"digest": "< digest > "
}
},
...
]
}
```
One or more layers may be missing during a manifest upload. If so, the missing layers will be enumerated in the error response.
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `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. |
2014-12-19 05:38:20 +00:00
2015-08-11 18:00:30 +00:00
###### On Failure: Not allowed
```
405 Method Not Allowed
```
Manifest put is not allowed because the registry is configured as a pull-through cache or for some other reason
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. |
2014-12-19 05:38:20 +00:00
#### DELETE Manifest
2015-06-05 01:59:08 +00:00
Delete the manifest identified by `name` and `reference` . Note that a manifest can _only_ be deleted by `digest` .
2014-12-19 05:38:20 +00:00
```
2015-02-26 02:04:28 +00:00
DELETE /v2/< name > /manifests/< reference >
2014-12-31 04:16:05 +00:00
Host: < registry host >
2014-12-19 05:38:20 +00:00
Authorization: < scheme > < token >
```
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
2015-06-01 15:14:03 +00:00
|`reference`|path|Tag or digest of the target manifest.|
2014-12-19 05:38:20 +00:00
###### On Success: Accepted
```
202 Accepted
```
2014-12-31 04:16:05 +00:00
2015-06-05 01:59:08 +00:00
###### On Failure: Invalid Name or Reference
2014-12-19 05:38:20 +00:00
```
400 Bad Request
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2014-12-19 05:38:20 +00:00
2015-06-05 01:59:08 +00:00
The specified `name` or `reference` were invalid and the delete was unable to proceed.
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-19 05:38:20 +00:00
| `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. |
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
2014-12-19 05:38:20 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
2014-12-31 04:16:05 +00:00
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-19 05:38:20 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-19 05:38:20 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-09-28 17:41:18 +00:00
###### On Failure: Unknown Manifest
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The specified `name` or `reference` 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.
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-19 05:38:20 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
| `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository. |
2015-08-11 18:00:30 +00:00
###### On Failure: Not allowed
```
405 Method Not Allowed
```
Manifest delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. |
2014-12-19 05:38:20 +00:00
### Blob
2015-08-03 18:59:19 +00:00
Operations on blobs identified by `name` and `digest` . Used to fetch or delete layers by digest.
2014-12-19 05:38:20 +00:00
#### GET Blob
2014-12-31 04:16:05 +00:00
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.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
##### Fetch Blob
2014-12-19 05:38:20 +00:00
```
GET /v2/< name > /blobs/< digest >
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
2014-12-19 05:38:20 +00:00
```
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
|`digest`|path|Digest of desired blob.|
###### On Success: OK
```
200 OK
2014-12-31 04:16:05 +00:00
Content-Length: < length >
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2014-12-19 05:38:20 +00:00
Content-Type: application/octet-stream
< blob binary data >
```
The blob identified by `digest` is available. The blob content will be present in the body of the request.
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Content-Length`|The length of the requested blob content.|
2015-02-26 02:04:28 +00:00
|`Docker-Content-Digest`|Digest of the targeted content for the request.|
2014-12-31 04:16:05 +00:00
2014-12-19 05:38:20 +00:00
###### On Success: Temporary Redirect
```
307 Temporary Redirect
Location: < blob location >
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2014-12-19 05:38:20 +00:00
```
The blob identified by `digest` is available at the provided location.
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
|Name|Description|
|----|-----------|
|`Location`|The location where the layer should be accessible.|
2015-02-26 02:04:28 +00:00
|`Docker-Content-Digest`|Digest of the targeted content for the request.|
2014-12-19 05:38:20 +00:00
###### On Failure: Bad Request
```
400 Bad Request
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag` .
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-19 05:38:20 +00:00
| `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. |
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The blob, identified by `name` and `digest` , is unknown to the registry.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
| `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. |
###### On Failure: Authentication Required
2014-12-19 05:38:20 +00:00
```
401 Unauthorized
2014-12-31 04:16:05 +00:00
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-19 05:38:20 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-19 05:38:20 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-19 05:38:20 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-31 04:16:05 +00:00
##### Fetch Blob Part
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
GET /v2/< name > /blobs/< digest >
Host: < registry host >
Authorization: < scheme > < token >
Range: bytes=< start > -< end >
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
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.
2014-12-19 05:38:20 +00:00
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
|`Range`|header|HTTP Range header specifying blob chunk.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
|`digest`|path|Digest of desired blob.|
2014-12-31 04:16:05 +00:00
###### On Success: Partial Content
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
```
206 Partial Content
Content-Length: < length >
Content-Range: bytes < start > -< end > /< size >
Content-Type: application/octet-stream
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
< blob binary data >
```
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The blob identified by `digest` is available. The specified chunk of blob content will be present in the body of the request.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
|Name|Description|
|----|-----------|
|`Content-Length`|The length of the requested blob chunk.|
|`Content-Range`|Content range of blob chunk.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Failure: Bad Request
```
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag` .
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-31 04:16:05 +00:00
| `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. |
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
| `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. |
###### On Failure: Requested Range Not Satisfiable
```
416 Requested Range Not Satisfiable
```
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.
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-31 04:16:05 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-31 04:16:05 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
2014-12-31 04:16:05 +00:00
```
2015-09-28 17:41:18 +00:00
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-31 04:16:05 +00:00
```
2015-09-28 17:41:18 +00:00
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-31 04:16:05 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
2014-12-31 04:16:05 +00:00
2016-07-12 18:18:54 +00:00
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
2015-08-03 18:59:19 +00:00
2016-07-12 18:18:54 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-08-03 18:59:19 +00:00
2016-07-12 18:18:54 +00:00
The client made too many requests within a time interval.
2015-08-03 18:59:19 +00:00
2016-07-12 18:18:54 +00:00
The following headers will be returned on the response:
2015-08-03 18:59:19 +00:00
2016-07-12 18:18:54 +00:00
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
#### DELETE Blob
Delete the blob identified by `name` and `digest`
```
DELETE /v2/< name > /blobs/< digest >
Host: < registry host >
2015-08-03 18:59:19 +00:00
Authorization: < scheme > < token >
```
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
|`name`|path|Name of the target repository.|
|`digest`|path|Digest of desired blob.|
###### On Success: Accepted
```
202 Accepted
Content-Length: 0
Docker-Content-Digest: < digest >
```
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
2015-08-06 23:25:08 +00:00
|`Content-Length`|0|
2015-08-03 18:59:19 +00:00
|`Docker-Content-Digest`|Digest of the targeted content for the request.|
###### On Failure: Invalid Name or Digest
```
400 Bad Request
```
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The blob, identified by `name` and `digest` , is unknown to the registry.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
| `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. |
###### On Failure: Method Not Allowed
```
405 Method Not Allowed
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-08-11 18:00:30 +00:00
Blob delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled
2015-08-03 18:59:19 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. |
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
2015-08-03 18:59:19 +00:00
2015-09-28 17:41:18 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
The following headers will be returned on the response:
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
###### On Failure: No Such Repository Error
```
404 Not Found
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-09-28 17:41:18 +00:00
### Initiate Blob Upload
Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.
#### POST Initiate 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.
##### Initiate Monolithic Blob Upload
2014-12-19 05:38:20 +00:00
```
2015-05-02 00:13:11 +00:00
POST /v2/< name > /blobs/uploads/?digest=< digest >
2014-12-31 04:16:05 +00:00
Host: < registry host >
2014-12-19 05:38:20 +00:00
Authorization: < scheme > < token >
Content-Length: < length of blob >
Content-Type: application/octect-stream
< binary data >
```
Upload a blob identified by the `digest` parameter in single request. This upload will not be resumable unless a recoverable error is returned.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`Content-Length`|header||
|`name`|path|Name of the target repository.|
|`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.|
###### On Success: Created
```
201 Created
Location: < blob location >
Content-Length: 0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-19 05:38:20 +00:00
```
2015-01-02 19:39:13 +00:00
The blob has been created in the registry and is available at the provided location.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
|Name|Description|
|----|-----------|
|`Location`||
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
2015-02-27 00:43:47 +00:00
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
2014-12-19 05:38:20 +00:00
###### On Failure: Invalid Name or Digest
```
400 Bad Request
```
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-19 05:38:20 +00:00
| `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. |
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Not allowed
```
405 Method Not Allowed
```
Blob upload is not allowed because the registry is configured as a pull-through cache or for some other reason
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. |
###### On Failure: Authentication Required
2014-12-19 05:38:20 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
2014-12-31 04:16:05 +00:00
Content-Length: < length >
Content-Type: application/json; charset=utf-8
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
```
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-19 05:38:20 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-19 05:38:20 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2015-08-11 18:00:30 +00:00
```
2015-09-28 17:41:18 +00:00
404 Not Found
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2015-08-11 18:00:30 +00:00
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2015-08-11 18:00:30 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2015-08-11 18:00:30 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-19 05:38:20 +00:00
##### Initiate Resumable Blob Upload
```
POST /v2/< name > /blobs/uploads/
2014-12-31 04:16:05 +00:00
Host: < registry host >
2014-12-19 05:38:20 +00:00
Authorization: < scheme > < token >
Content-Length: 0
```
Initiate a resumable blob upload with an empty request body.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.|
|`name`|path|Name of the target repository.|
###### On Success: Accepted
```
202 Accepted
Content-Length: 0
Location: /v2/< name > /blobs/uploads/< uuid >
Range: 0-0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
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.
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
|Name|Description|
|----|-----------|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
|`Location`|The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
|`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.|
2015-02-27 00:43:47 +00:00
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Failure: Invalid Name or Digest
```
400 Bad Request
```
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-31 04:16:05 +00:00
| `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. |
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2015-12-15 02:34:18 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
###### On Failure: No Such Repository Error
```
404 Not Found
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-12-15 02:34:18 +00:00
##### Mount Blob
```
POST /v2/< name > /blobs/uploads/?mount=< digest > & from=< repository name >
Host: < registry host >
Authorization: < scheme > < token >
Content-Length: 0
```
Mount a blob identified by the `mount` parameter from another repository.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
|`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.|
|`name`|path|Name of the target repository.|
|`mount`|query|Digest of blob to mount from the source repository.|
|`from`|query|Name of the source repository.|
###### On Success: Created
```
201 Created
Location: < blob location >
Content-Length: 0
Docker-Upload-UUID: < uuid >
```
The blob has been mounted in the repository and is available at the provided location.
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Location`||
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
###### On Failure: Invalid Name or Digest
```
400 Bad Request
```
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
###### On Failure: Not allowed
```
405 Method Not Allowed
```
Blob mount is not allowed because the registry is configured as a pull-through cache or for some other reason
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. |
###### On Failure: Authentication Required
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client is not authenticated.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
2015-09-28 17:41:18 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
###### On Failure: No Such Repository Error
```
404 Not Found
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-31 04:16:05 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-31 04:16:05 +00:00
2014-12-19 05:38:20 +00:00
### Blob Upload
2014-12-31 04:16:05 +00:00
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.
2014-12-19 05:38:20 +00:00
#### GET 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.
```
GET /v2/< name > /blobs/uploads/< uuid >
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
2014-12-19 05:38:20 +00:00
```
Retrieve the progress of the current upload, as reported by the `Range` header.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
2015-04-02 01:57:59 +00:00
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+` .|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Success: Upload Progress
2014-12-19 05:38:20 +00:00
```
204 No Content
Range: 0-< offset >
2014-12-31 04:16:05 +00:00
Content-Length: 0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
The upload is known and in progress. The last received offset is available in the `Range` header.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
|Name|Description|
|----|-----------|
|`Range`|Range indicating the current progress of the upload.|
2014-12-31 04:16:05 +00:00
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
2015-02-27 00:43:47 +00:00
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Failure: Bad Request
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
There was an error processing the upload and it must be restarted.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-31 04:16:05 +00:00
| `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. |
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-31 04:16:05 +00:00
| `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
2014-12-19 05:38:20 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The upload is unknown to the registry. The upload must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
###### On Failure: Authentication Required
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-19 05:38:20 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
2014-12-31 04:16:05 +00:00
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-31 04:16:05 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-19 05:38:20 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-19 05:38:20 +00:00
#### PATCH Blob Upload
Upload a chunk of data for the specified upload.
2015-05-04 15:56:37 +00:00
##### Stream upload
```
PATCH /v2/< name > /blobs/uploads/< uuid >
Host: < registry host >
Authorization: < scheme > < token >
Content-Type: application/octet-stream
< binary data >
```
Upload a stream of data to upload without completing the upload.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
|`name`|path|Name of the target repository.|
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+` .|
###### On Success: Data Accepted
```
204 No Content
Location: /v2/< name > /blobs/uploads/< uuid >
Range: 0-< offset >
Content-Length: 0
Docker-Upload-UUID: < uuid >
```
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.
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`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.|
|`Range`|Range indicating the current progress of the upload.|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
###### On Failure: Bad Request
```
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
There was an error processing the upload and it must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-05-04 15:56:37 +00:00
| `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. |
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
| `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The upload is unknown to the registry. The upload must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
###### On Failure: Authentication Required
2015-05-04 15:56:37 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client is not authenticated.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
###### On Failure: No Such Repository Error
```
404 Not Found
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
2015-05-04 15:56:37 +00:00
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
2015-05-04 15:56:37 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2015-05-04 15:56:37 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2015-05-04 15:56:37 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
2015-05-04 15:56:37 +00:00
```
2015-09-28 17:41:18 +00:00
403 Forbidden
Content-Length: < length >
2015-05-04 15:56:37 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2015-05-04 15:56:37 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2015-05-04 15:56:37 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2015-05-04 15:56:37 +00:00
##### Chunked upload
2014-12-19 05:38:20 +00:00
```
PATCH /v2/< name > /blobs/uploads/< uuid >
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
2014-12-19 05:38:20 +00:00
Content-Range: < start of range > -< end of range , inclusive >
Content-Length: < length of chunk >
Content-Type: application/octet-stream
< binary chunk >
```
2015-05-04 15:56:37 +00:00
Upload a chunk of data to specified upload without completing the upload. The data will be uploaded to the specified Content Range.
2014-12-19 05:38:20 +00:00
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2014-12-19 05:38:20 +00:00
|`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.|
|`Content-Length`|header|Length of the chunk being uploaded, corresponding the length of the request body.|
|`name`|path|Name of the target repository.|
2015-04-02 01:57:59 +00:00
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+` .|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Success: Chunk Accepted
2014-12-19 05:38:20 +00:00
```
204 No Content
2014-12-31 04:16:05 +00:00
Location: /v2/< name > /blobs/uploads/< uuid >
2014-12-19 05:38:20 +00:00
Range: 0-< offset >
Content-Length: 0
2015-02-27 00:43:47 +00:00
Docker-Upload-UUID: < uuid >
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
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.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
|Name|Description|
|----|-----------|
2014-12-31 04:16:05 +00:00
|`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.|
2014-12-19 05:38:20 +00:00
|`Range`|Range indicating the current progress of the upload.|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
2015-02-27 00:43:47 +00:00
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Failure: Bad Request
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
There was an error processing the upload and it must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-31 04:16:05 +00:00
| `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. |
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-31 04:16:05 +00:00
| `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The upload is unknown to the registry. The upload must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
###### On Failure: Requested Range Not Satisfiable
```
416 Requested Range Not Satisfiable
```
The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid.
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-31 04:16:05 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Access Denied
2014-12-31 04:16:05 +00:00
```
2015-09-28 17:41:18 +00:00
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
2014-12-19 05:38:20 +00:00
```
2015-09-28 17:41:18 +00:00
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-31 04:16:05 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-31 04:16:05 +00:00
#### PUT Blob Upload
Complete the upload specified by `uuid` , optionally appending the body as the final chunk.
```
2015-05-02 00:13:11 +00:00
PUT /v2/< name > /blobs/uploads/< uuid > ?digest=< digest >
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
2015-05-04 15:56:37 +00:00
Content-Length: < length of data >
2014-12-31 04:16:05 +00:00
Content-Type: application/octet-stream
2015-05-04 15:56:37 +00:00
< binary data >
2014-12-31 04:16:05 +00:00
```
2015-05-04 15:56:37 +00:00
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.
2014-12-19 05:38:20 +00:00
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
2015-05-04 15:56:37 +00:00
|`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.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
2015-04-02 01:57:59 +00:00
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+` .|
2014-12-19 05:38:20 +00:00
|`digest`|query|Digest of uploaded blob.|
2014-12-31 04:16:05 +00:00
###### On Success: Upload Complete
2014-12-19 05:38:20 +00:00
```
204 No Content
2014-12-31 04:16:05 +00:00
Location: < blob location >
2014-12-19 05:38:20 +00:00
Content-Range: < start of range > -< end of range , inclusive >
2015-04-16 00:55:15 +00:00
Content-Length: 0
2015-02-26 02:04:28 +00:00
Docker-Content-Digest: < digest >
2014-12-19 05:38:20 +00:00
```
2014-12-31 04:16:05 +00:00
The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header.
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
The following headers will be returned with the response:
2014-12-19 05:38:20 +00:00
|Name|Description|
|----|-----------|
2015-04-16 00:55:15 +00:00
|`Location`|The canonical location of the blob for retrieval|
2014-12-19 05:38:20 +00:00
|`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.|
2015-04-16 00:55:15 +00:00
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
2015-02-26 02:04:28 +00:00
|`Docker-Content-Digest`|Digest of the targeted content for the request.|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Failure: Bad Request
```
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
There was an error processing the upload and it must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2014-12-31 04:16:05 +00:00
| `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. |
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-31 04:16:05 +00:00
| `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
2015-08-11 18:00:30 +00:00
| `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The upload is unknown to the registry. The upload must be restarted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-31 04:16:05 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-31 04:16:05 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-31 04:16:05 +00:00
2014-12-19 05:38:20 +00:00
#### DELETE Blob Upload
Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout.
```
DELETE /v2/< name > /blobs/uploads/< uuid >
2014-12-31 04:16:05 +00:00
Host: < registry host >
Authorization: < scheme > < token >
Content-Length: 0
2014-12-19 05:38:20 +00:00
```
Cancel the upload specified by `uuid` .
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
2014-12-31 04:16:05 +00:00
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Authorization`|header|An RFC7235 compliant authorization header.|
|`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.|
2014-12-19 05:38:20 +00:00
|`name`|path|Name of the target repository.|
2015-04-02 01:57:59 +00:00
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+` .|
2014-12-19 05:38:20 +00:00
2014-12-31 04:16:05 +00:00
###### On Success: Upload Deleted
```
204 No Content
Content-Length: 0
```
The upload has been successfully deleted.
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
###### On Failure: Bad Request
```
400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
An error was encountered processing the delete. The client may ignore this error.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-02-07 01:49:50 +00:00
| `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2014-12-31 04:16:05 +00:00
| `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. |
2015-09-28 17:41:18 +00:00
###### On Failure: Not Found
```
404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The upload is unknown to the registry. The client may ignore this error and assume the upload has been deleted.
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `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. |
###### On Failure: Authentication Required
2014-12-31 04:16:05 +00:00
```
401 Unauthorized
WWW-Authenticate: < scheme > realm="< realm > ", ..."
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
2015-09-28 17:41:18 +00:00
"code": < error code > ,
"message": "< error message > ",
2014-12-31 04:16:05 +00:00
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The client is not authenticated.
2014-12-31 04:16:05 +00:00
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.|
2015-09-28 17:41:18 +00:00
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. |
2014-12-31 04:16:05 +00:00
2015-09-28 17:41:18 +00:00
###### On Failure: No Such Repository Error
2014-12-31 04:16:05 +00:00
```
404 Not Found
2015-09-28 17:41:18 +00:00
Content-Length: < length >
2014-12-31 04:16:05 +00:00
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
2015-09-28 17:41:18 +00:00
The repository is not known to the registry.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2014-12-31 04:16:05 +00:00
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
2015-06-26 08:34:48 +00:00
|----|-------|-----------|
2015-09-28 17:41:18 +00:00
| `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. |
###### On Failure: Access Denied
```
403 Forbidden
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client does not have required access to the repository.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. |
2014-12-31 04:16:05 +00:00
2014-12-18 22:50:07 +00:00
2016-07-12 18:18:54 +00:00
###### On Failure: Too Many Requests
```
429 Too Many Requests
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"errors:" [
{
"code": < error code > ,
"message": "< error message > ",
"detail": ...
},
...
]
}
```
The client made too many requests within a time interval.
The following headers will be returned on the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
The error codes that may be included in the response body are enumerated below:
|Code|Message|Description|
|----|-------|-----------|
| `TOOMANYREQUESTS` | too many requests | Returned when a client attempts to contact a service too many times |
2014-12-18 22:50:07 +00:00
2015-06-02 02:10:51 +00:00
### Catalog
List a set of available repositories in the local registry cluster. Does not provide any indication of what may be available upstream. Applications can only determine if a repository is available but not if it is not available.
#### GET Catalog
Retrieve a sorted, json list of repositories available in the registry.
2016-06-08 17:39:17 +00:00
##### Catalog Fetch
2015-06-02 02:10:51 +00:00
```
GET /v2/_catalog
```
2016-06-08 17:39:17 +00:00
Request an unabridged list of repositories available. The implementation may impose a maximum limit and return a partial set with pagination links.
2015-06-02 02:10:51 +00:00
###### On Success: OK
```
200 OK
Content-Length: < length >
Content-Type: application/json; charset=utf-8
{
"repositories": [
< name > ,
...
]
}
```
Returns the unabridged list of repositories as a json response.
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
##### Catalog Fetch Paginated
```
2015-07-25 02:00:25 +00:00
GET /v2/_catalog?n=< integer > & last=< integer >
2015-06-02 02:10:51 +00:00
```
Return the specified portion of repositories.
The following parameters should be specified on the request:
|Name|Kind|Description|
|----|----|-----------|
|`n`|query|Limit the number of entries in each response. It not present, all entries will be returned.|
|`last`|query|Result set will include values lexically after last.|
###### On Success: OK
```
200 OK
Content-Length: < length >
2015-07-23 03:00:28 +00:00
Link: < < url > ?n=< last n value > & last=< last entry from response > >; rel="next"
2015-06-02 02:10:51 +00:00
Content-Type: application/json; charset=utf-8
{
"repositories": [
< name > ,
...
]
"next": "< url > ?last=< name > & n=< last value of n > "
}
```
The following headers will be returned with the response:
|Name|Description|
|----|-----------|
|`Content-Length`|Length of the JSON response body.|
2015-06-03 03:16:59 +00:00
|`Link`|RFC5988 compliant rel='next' with URL to next result set, if available|
2015-06-02 02:10:51 +00:00