2015-06-07 23:07:20 -04:00
|
|
|
|
<!--[metadata]>
|
|
|
|
|
+++
|
|
|
|
|
title = "Registry API"
|
|
|
|
|
description = "API Documentation for Docker Registry"
|
|
|
|
|
keywords = ["API, Docker, index, registry, REST, documentation"]
|
|
|
|
|
[menu.main]
|
|
|
|
|
parent="smn_registry_ref"
|
|
|
|
|
+++
|
|
|
|
|
<![end-metadata]-->
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2015-04-15 22:02:01 -04:00
|
|
|
|
# Docker Registry API v1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
|
|
2015-04-15 22:02:01 -04:00
|
|
|
|
- This is the REST API for the Docker Registry 1.0
|
2014-04-23 16:48:28 -04:00
|
|
|
|
- It stores the images and the graph for a set of repositories
|
|
|
|
|
- It does not have user accounts data
|
|
|
|
|
- It has no notion of user accounts or authorization
|
|
|
|
|
- It delegates authentication and authorization to the Index Auth
|
|
|
|
|
service using tokens
|
|
|
|
|
- It supports different storage backends (S3, cloud files, local FS)
|
|
|
|
|
- It doesn't have a local database
|
2014-11-30 23:12:57 -05:00
|
|
|
|
- The registry is open source: [Docker Registry](https://github.com/docker/docker-registry)
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-11-30 23:12:57 -05:00
|
|
|
|
We expect that there will be multiple registries out there. To help to
|
2014-04-15 20:53:12 -04:00
|
|
|
|
grasp the context, here are some examples of registries:
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
- **sponsor registry**: such a registry is provided by a third-party
|
|
|
|
|
hosting infrastructure as a convenience for their customers and the
|
2014-10-22 08:30:48 -04:00
|
|
|
|
Docker community as a whole. Its costs are supported by the third
|
2014-04-23 16:48:28 -04:00
|
|
|
|
party, but the management and operation of the registry are
|
2014-10-22 08:30:48 -04:00
|
|
|
|
supported by Docker. It features read/write access, and delegates
|
2014-04-23 16:48:28 -04:00
|
|
|
|
authentication and authorization to the Index.
|
|
|
|
|
- **mirror registry**: such a registry is provided by a third-party
|
|
|
|
|
hosting infrastructure but is targeted at their customers only. Some
|
|
|
|
|
mechanism (unspecified to date) ensures that public images are
|
|
|
|
|
pulled from a sponsor registry to the mirror registry, to make sure
|
2014-10-22 08:30:48 -04:00
|
|
|
|
that the customers of the third-party provider can `docker pull`
|
2014-04-23 16:48:28 -04:00
|
|
|
|
those images locally.
|
|
|
|
|
- **vendor registry**: such a registry is provided by a software
|
2014-10-22 08:30:48 -04:00
|
|
|
|
vendor, who wants to distribute Docker images. It would be operated
|
2014-04-23 16:48:28 -04:00
|
|
|
|
and managed by the vendor. Only users authorized by the vendor would
|
|
|
|
|
be able to get write access. Some images would be public (accessible
|
|
|
|
|
for anyone), others private (accessible only for authorized users).
|
|
|
|
|
Authentication and authorization would be delegated to the Index.
|
2014-10-22 08:30:48 -04:00
|
|
|
|
The goal of vendor registries is to let someone do `docker pull
|
|
|
|
|
basho/riak1.3` and automatically push from the vendor registry
|
|
|
|
|
(instead of a sponsor registry); i.e., get all the convenience of a
|
2014-04-23 16:48:28 -04:00
|
|
|
|
sponsor registry, while retaining control on the asset distribution.
|
|
|
|
|
- **private registry**: such a registry is located behind a firewall,
|
|
|
|
|
or protected by an additional security layer (HTTP authorization,
|
|
|
|
|
SSL client-side certificates, IP address authorization...). The
|
2014-10-22 08:30:48 -04:00
|
|
|
|
registry is operated by a private entity, outside of Docker's
|
2014-04-23 16:48:28 -04:00
|
|
|
|
control. It can optionally delegate additional authorization to the
|
|
|
|
|
Index, but it is not mandatory.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-18 16:21:55 -04:00
|
|
|
|
> **Note**:
|
|
|
|
|
> Mirror registries and private registries which do not use the Index
|
2014-04-23 16:48:28 -04:00
|
|
|
|
> don't even need to run the registry code. They can be implemented by any
|
2014-04-18 16:21:55 -04:00
|
|
|
|
> kind of transport implementing HTTP GET and PUT. Read-only registries
|
2014-10-22 08:30:48 -04:00
|
|
|
|
> can be powered by a simple static HTTPS server.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-18 16:21:55 -04:00
|
|
|
|
> **Note**:
|
|
|
|
|
> The latter implies that while HTTP is the protocol of choice for a registry,
|
|
|
|
|
> multiple schemes are possible (and in some cases, trivial):
|
2014-07-12 18:28:55 -04:00
|
|
|
|
>
|
2014-04-18 16:21:55 -04:00
|
|
|
|
> - HTTP with GET (and PUT for read-write registries);
|
|
|
|
|
> - local mount point;
|
2014-10-22 08:30:48 -04:00
|
|
|
|
> - remote Docker addressed through SSH.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-10-22 08:30:48 -04:00
|
|
|
|
The latter would only require two new commands in Docker, e.g.,
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`registryget` and `registryput`, wrapping access to the local filesystem
|
|
|
|
|
(and optionally doing consistency checks). Authentication and authorization
|
2014-06-29 21:31:15 -04:00
|
|
|
|
are then delegated to SSH (e.g., with public keys).
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-10-22 08:30:48 -04:00
|
|
|
|
> **Note**:
|
|
|
|
|
> Private registry servers that expose an HTTP endpoint need to be secured with
|
|
|
|
|
> TLS (preferably TLSv1.2, but at least TLSv1.0). Make sure to put the CA
|
|
|
|
|
> certificate at /etc/docker/certs.d/my.registry.com:5000/ca.crt on the Docker
|
|
|
|
|
> host, so that the daemon can securely access the private registry.
|
|
|
|
|
> Support for SSLv3 and lower is not available due to security issues.
|
|
|
|
|
|
2014-07-23 07:11:14 -04:00
|
|
|
|
The default namespace for a private repository is `library`.
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
# Endpoints
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
## Images
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Get image layer
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/images/(image_id)/layer`
|
|
|
|
|
|
|
|
|
|
Get image layer for a given `image_id`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/layer HTTP/1.1
|
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Token signature=123abc,repository="foo/bar",access=read
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **image_id** – the id for the layer you want to get
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
|
|
|
|
{layer binary data stream}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Image not found
|
|
|
|
|
|
|
|
|
|
### Put image layer
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`PUT /v1/images/(image_id)/layer`
|
|
|
|
|
|
|
|
|
|
Put image layer for a given `image_id`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/layer HTTP/1.1
|
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Transfer-Encoding: chunked
|
|
|
|
|
Authorization: Token signature=123abc,repository="foo/bar",access=write
|
|
|
|
|
|
|
|
|
|
{layer binary data stream}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **image_id** – the id for the layer you want to get
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Image not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
## Image
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Put image layer
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`PUT /v1/images/(image_id)/json`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Put image for a given `image_id`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/json HTTP/1.1
|
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: "088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c",
|
|
|
|
|
parent: "aeee6396d62273d180a49c96c62e45438d87c7da4a5cf5d2be6bee4e21bc226f",
|
|
|
|
|
created: "2013-04-30T17:46:10.843673+03:00",
|
|
|
|
|
container: "8305672a76cc5e3d168f97221106ced35a76ec7ddbb03209b0f0d96bf74f6ef7",
|
|
|
|
|
container_config: {
|
|
|
|
|
Hostname: "host-test",
|
|
|
|
|
User: "",
|
|
|
|
|
Memory: 0,
|
|
|
|
|
MemorySwap: 0,
|
|
|
|
|
AttachStdin: false,
|
|
|
|
|
AttachStdout: false,
|
|
|
|
|
AttachStderr: false,
|
|
|
|
|
Tty: false,
|
|
|
|
|
OpenStdin: false,
|
|
|
|
|
StdinOnce: false,
|
|
|
|
|
Env: null,
|
|
|
|
|
Cmd: [
|
|
|
|
|
"/bin/bash",
|
|
|
|
|
"-c",
|
|
|
|
|
"apt-get -q -yy -f install libevent-dev"
|
|
|
|
|
],
|
|
|
|
|
Dns: null,
|
|
|
|
|
Image: "imagename/blah",
|
|
|
|
|
Volumes: { },
|
|
|
|
|
VolumesFrom: ""
|
|
|
|
|
},
|
|
|
|
|
docker_version: "0.1.7"
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **image_id** – the id for the layer you want to get
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Get image layer
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/images/(image_id)/json`
|
|
|
|
|
|
|
|
|
|
Get image for a given `image_id`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/json HTTP/1.1
|
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **image_id** – the id for the layer you want to get
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
X-Docker-Size: 456789
|
|
|
|
|
X-Docker-Checksum: b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: "088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c",
|
|
|
|
|
parent: "aeee6396d62273d180a49c96c62e45438d87c7da4a5cf5d2be6bee4e21bc226f",
|
|
|
|
|
created: "2013-04-30T17:46:10.843673+03:00",
|
|
|
|
|
container: "8305672a76cc5e3d168f97221106ced35a76ec7ddbb03209b0f0d96bf74f6ef7",
|
|
|
|
|
container_config: {
|
|
|
|
|
Hostname: "host-test",
|
|
|
|
|
User: "",
|
|
|
|
|
Memory: 0,
|
|
|
|
|
MemorySwap: 0,
|
|
|
|
|
AttachStdin: false,
|
|
|
|
|
AttachStdout: false,
|
|
|
|
|
AttachStderr: false,
|
|
|
|
|
Tty: false,
|
|
|
|
|
OpenStdin: false,
|
|
|
|
|
StdinOnce: false,
|
|
|
|
|
Env: null,
|
|
|
|
|
Cmd: [
|
|
|
|
|
"/bin/bash",
|
|
|
|
|
"-c",
|
|
|
|
|
"apt-get -q -yy -f install libevent-dev"
|
|
|
|
|
],
|
|
|
|
|
Dns: null,
|
|
|
|
|
Image: "imagename/blah",
|
|
|
|
|
Volumes: { },
|
|
|
|
|
VolumesFrom: ""
|
|
|
|
|
},
|
|
|
|
|
docker_version: "0.1.7"
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Image not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
## Ancestry
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Get image ancestry
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/images/(image_id)/ancestry`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Get ancestry for an image given an `image_id`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/ancestry HTTP/1.1
|
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **image_id** – the id for the layer you want to get
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
["088b4502f51920fbd9b7c503e87c7a2c05aa3adc3d35e79c031fa126b403200f",
|
|
|
|
|
"aeee63968d87c7da4a5cf5d2be6bee4e21bc226fd62273d180a49c96c62e4543",
|
|
|
|
|
"bfa4c5326bc764280b0863b46a4b20d940bc1897ef9c1dfec060604bdc383280",
|
|
|
|
|
"6ab5893c6927c15a15665191f2c6cf751f5056d8b95ceee32e43c5e8a3648544"]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Image not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
## Tags
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### List repository tags
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/repositories/(namespace)/(repository)/tags`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Get all of the tags for the given repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-23 07:11:14 -04:00
|
|
|
|
GET /v1/repositories/reynholm/help-system-server/tags HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – namespace for the repo
|
|
|
|
|
- **repository** – name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"latest": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
|
|
|
|
|
"0.1.1": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Repository not found
|
|
|
|
|
|
|
|
|
|
### Get image id for a particular tag
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-12 18:28:55 -04:00
|
|
|
|
`GET /v1/repositories/(namespace)/(repository)/tags/(tag*)`
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
Get a tag for the given repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-23 07:11:14 -04:00
|
|
|
|
GET /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – namespace for the repo
|
|
|
|
|
- **repository** – name for the repo
|
|
|
|
|
- **tag** – name of tag you want to get
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Tag not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Delete a repository tag
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-12 18:28:55 -04:00
|
|
|
|
`DELETE /v1/repositories/(namespace)/(repository)/tags/(tag*)`
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
Delete the tag for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-23 07:11:14 -04:00
|
|
|
|
DELETE /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – namespace for the repo
|
|
|
|
|
- **repository** – name for the repo
|
|
|
|
|
- **tag** – name of tag you want to delete
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Tag not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Set a tag for a specified image id
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-12 18:28:55 -04:00
|
|
|
|
`PUT /v1/repositories/(namespace)/(repository)/tags/(tag*)`
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
Put a tag for the given repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-23 07:11:14 -04:00
|
|
|
|
PUT /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
|
|
|
|
"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – namespace for the repo
|
|
|
|
|
- **repository** – name for the repo
|
|
|
|
|
- **tag** – name of tag you want to add
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **400** – Invalid data
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Image not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
## Repositories
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Delete a repository
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`DELETE /v1/repositories/(namespace)/(repository)/`
|
|
|
|
|
|
|
|
|
|
Delete a repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-07-23 07:11:14 -04:00
|
|
|
|
DELETE /v1/repositories/reynholm/help-system-server/ HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Cookie: (Cookie provided by the Registry)
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – namespace for the repo
|
|
|
|
|
- **repository** – name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **401** – Requires authorization
|
|
|
|
|
- **404** – Repository not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-10-13 21:52:10 -04:00
|
|
|
|
## Search
|
|
|
|
|
|
|
|
|
|
If you need to search the index, this is the endpoint you would use.
|
|
|
|
|
|
|
|
|
|
`GET /v1/search`
|
|
|
|
|
|
|
|
|
|
Search the Index given a search term. It accepts
|
|
|
|
|
|
|
|
|
|
[GET](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3)
|
|
|
|
|
only.
|
|
|
|
|
|
|
|
|
|
**Example request**:
|
|
|
|
|
|
2014-12-29 13:39:09 -05:00
|
|
|
|
GET /v1/search?q=search_term&page=1&n=25 HTTP/1.1
|
2014-10-13 21:52:10 -04:00
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
|
2015-01-02 19:21:51 -05:00
|
|
|
|
Query Parameters:
|
|
|
|
|
|
|
|
|
|
- **q** – what you want to search for
|
|
|
|
|
- **n** - number of results you want returned per page (default: 25, min:1, max:100)
|
|
|
|
|
- **page** - page number of results
|
|
|
|
|
|
2014-10-13 21:52:10 -04:00
|
|
|
|
**Example response**:
|
|
|
|
|
|
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
2015-01-02 19:21:51 -05:00
|
|
|
|
{"num_pages": 1,
|
2014-10-13 21:52:10 -04:00
|
|
|
|
"num_results": 3,
|
|
|
|
|
"results" : [
|
|
|
|
|
{"name": "ubuntu", "description": "An ubuntu image..."},
|
|
|
|
|
{"name": "centos", "description": "A centos image..."},
|
|
|
|
|
{"name": "fedora", "description": "A fedora image..."}
|
2015-01-02 19:21:51 -05:00
|
|
|
|
],
|
|
|
|
|
"page_size": 25,
|
|
|
|
|
"query":"search_term",
|
|
|
|
|
"page": 1
|
2014-10-13 21:52:10 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-01-02 19:21:51 -05:00
|
|
|
|
Response Items:
|
|
|
|
|
- **num_pages** - Total number of pages returned by query
|
|
|
|
|
- **num_results** - Total number of results returned by query
|
|
|
|
|
- **results** - List of results for the current page
|
|
|
|
|
- **page_size** - How many results returned per page
|
|
|
|
|
- **query** - Your search term
|
|
|
|
|
- **page** - Current page number
|
2014-10-13 21:52:10 -04:00
|
|
|
|
|
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – no error
|
|
|
|
|
- **500** – server error
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
## Status
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Status check for registry
|
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/_ping`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Check status of the registry. This endpoint is also used to
|
|
|
|
|
determine if the registry supports SSL.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /v1/_ping HTTP/1.1
|
|
|
|
|
Host: registry-1.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
X-Docker-Registry-Version: 0.6.0
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
## Authorization
|
|
|
|
|
|
|
|
|
|
This is where we describe the authorization process, including the
|
|
|
|
|
tokens and cookies.
|
|
|
|
|
|