Files
docker-docs/reference/api/docker-io_api/index.html
2017-03-09 14:46:47 -08:00

1203 lines
44 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="docker_version" content="1.4.1">
<meta name="docker_git_branch" content="master">
<meta name="docker_git_commit" content="3c097c2">
<meta name="docker_build_date" content="Wed Jan 28 04:30:29 UTC 2015">
<meta name="description" content="API Documentation for the Docker Hub API">
<meta name="keywords" content="API, Docker, index, REST, documentation, Docker Hub, registry">
<link rel="canonical" href="/reference/api/docker-io_api/">
<link href="/css/bootstrap-custom.css" rel="stylesheet">
<link href="/css/main.css" rel="stylesheet">
<link href="/css/prettify-1.0.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/css/dockerfile_tutorial.css">
<link href="/tipuesearch/tipuesearch.css" rel="stylesheet">
<link href="/css/docs.css" rel="stylesheet">
<link rel="shortcut icon" href="/img/favicon.png">
<title>Docker Hub API - Docker Documentation</title>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0";
analytics.load("IWj9D0UpZHZdZUZX9jl98PcpBFWBnBMy");
analytics.page();
}}();
</script>
</head>
<body>
<div id="topmostnav" class="topmostnav_loggedout navbar navbar-static-top public">
<div class="container">
<a href="http://www.docker.com/" title="Homepage">
<div class="brand logo"><img src="/img/nav/docker-logo-loggedout.png"> </div>
</a>
<ul class="nav">
<li class=""><a href="http://www.docker.com/whatisdocker/" title="What is Docker">What is Docker?</a></li>
<li class=""><a href="http://www.docker.com/resources/usecases/" title="Use Cases">Use Cases</a></li>
<li class=""><a href="http://www.docker.com/tryit/" title="Try It!">Try It!</a></li>
<li class="active"><a href="https://docs.docker.com" title="Install &amp; Docs">Install &amp; Docs</a></li>
<li><a href="https://registry.hub.docker.com" title="Browse">Browse</a></li>
</ul>
<div id="usernav" class="pull-right">
<a href="https://hub.docker.com/account/login" class="btn nav-button2" title="Lg In">Log In</a>
<a href="https://hub.docker.com/account/signup" class="btn nav-button1" title="Sign Up">Sign Up</a>
</div>
</div>
</div>
<div id="topmostnav" class="topmostnav_loggedin navbar navbar-static-top">
<div class="container">
<a href="http://www.docker.com/" title="Docker Docs Home"><div class="brand logo"><img src="/img/nav/docker-logo-loggedin.png"> </div></a>
<form id="search_box_header" class="navbar-index-search pull-right" action="https://registry.hub.docker.com/search">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" class="search-query ui-autocomplete-input" placeholder="Search..." name="q" value="" autocomplete="off">
</form>
<ul class="nav">
<li><a href="https://registry.hub.docker.com" title="Browse Repos">Browse Repos</a></li>
<li class="active"><a href="http://docs.docker.com" title="Documentation">Documentation</a></li>
<li><a href="http://www.docker.com/community/participate/" title="Community">Community</a></li>
<li><a href="http://www.docker.com/resources/help/" title="Help">Help</a></li>
</ul>
<div id="usernav" class="pull-right">
<ul class="nav user">
<li class="dropdown">
<a id="logged-in-header-username" class="dropdown-toggle" data-toggle="dropdown" href="#">
<img class="profile" src="" alt="profile picture">
</a>
<ul class="dropdown-menu pull-right">
<li><a href="https://hub.docker.com/">View Profile</a></li>
<li><a href="https://hub.docker.com/account/settings/">Settings</a></li>
<li><a href="https://hub.docker.com/repos/">My Repositories</a></li>
<li><a href="https://hub.docker.com/plans/billing-info">Billing</a></li>
<li><a href="https://hub.docker.com/account/logout/?next=/">Log out</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="wrap">
<nav id="nav_menu" class="clearfix navbar navbar-default navbar-static-top affix" role="navigation">
<div id="docsnav">
<ul id="main-nav" class="pull-left">
<li class="dd_menu pull-left">
<a href="/">About</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/">Docker</a>
</li>
<li >
<a href="/release-notes/">Release Notes</a>
</li>
<li >
<a href="/introduction/understanding-docker/">Understanding Docker</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left">
<a href="/installation/mac/">Installation</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/installation/mac/">Mac OS X</a>
</li>
<li >
<a href="/installation/ubuntulinux/">Ubuntu</a>
</li>
<li >
<a href="/installation/rhel/">Red Hat Enterprise Linux</a>
</li>
<li >
<a href="/installation/oracle/">Oracle Linux</a>
</li>
<li >
<a href="/installation/centos/">CentOS</a>
</li>
<li >
<a href="/installation/debian/">Debian</a>
</li>
<li >
<a href="/installation/gentoolinux/">Gentoo</a>
</li>
<li >
<a href="/installation/google/">Google Cloud Platform</a>
</li>
<li >
<a href="/installation/rackspace/">Rackspace Cloud</a>
</li>
<li >
<a href="/installation/amazon/">Amazon EC2</a>
</li>
<li >
<a href="/installation/softlayer/">IBM Softlayer</a>
</li>
<li >
<a href="/installation/archlinux/">Arch Linux</a>
</li>
<li >
<a href="/installation/frugalware/">FrugalWare</a>
</li>
<li >
<a href="/installation/fedora/">Fedora</a>
</li>
<li >
<a href="/installation/SUSE/">SUSE</a>
</li>
<li >
<a href="/installation/cruxlinux/">CRUX Linux</a>
</li>
<li >
<a href="/installation/windows/">Microsoft Windows</a>
</li>
<li >
<a href="/installation/binaries/">Binaries</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left">
<a href="/userguide/">User Guide</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/userguide/">The Docker User Guide</a>
</li>
<li >
<a href="/userguide/dockerhub/">Getting Started with Docker Hub</a>
</li>
<li >
<a href="/userguide/dockerizing/">Dockerizing Applications</a>
</li>
<li >
<a href="/userguide/usingdocker/">Working with Containers</a>
</li>
<li >
<a href="/userguide/dockerimages/">Working with Docker Images</a>
</li>
<li >
<a href="/userguide/dockerlinks/">Linking containers together</a>
</li>
<li >
<a href="/userguide/dockervolumes/">Managing data in containers</a>
</li>
<li >
<a href="/userguide/dockerrepos/">Working with Docker Hub</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left">
<a href="/docker-hub/">Docker Hub</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/docker-hub/">Docker Hub</a>
</li>
<li >
<a href="/docker-hub/accounts/">Accounts</a>
</li>
<li >
<a href="/docker-hub/repos/">Repositories</a>
</li>
<li >
<a href="/docker-hub/builds/">Automated Builds</a>
</li>
<li >
<a href="/docker-hub/official_repos/">Official Repo Guidelines</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left">
<a href="/examples/nodejs_web_app/">Examples</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/examples/nodejs_web_app/">Dockerizing a Node.js web application</a>
</li>
<li >
<a href="/examples/mongodb/">Dockerizing MongoDB</a>
</li>
<li >
<a href="/examples/running_redis_service/">Dockerizing a Redis service</a>
</li>
<li >
<a href="/examples/postgresql_service/">Dockerizing a PostgreSQL service</a>
</li>
<li >
<a href="/examples/running_riak_service/">Dockerizing a Riak service</a>
</li>
<li >
<a href="/examples/running_ssh_service/">Dockerizing an SSH service</a>
</li>
<li >
<a href="/examples/couchdb_data_volumes/">Dockerizing a CouchDB service</a>
</li>
<li >
<a href="/examples/apt-cacher-ng/">Dockerizing an Apt-Cacher-ng service</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left">
<a href="/articles/basics/">Articles</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/articles/basics/">Docker basics</a>
</li>
<li >
<a href="/articles/networking/">Advanced networking</a>
</li>
<li >
<a href="/articles/security/">Security</a>
</li>
<li >
<a href="/articles/https/">Running Docker with HTTPS</a>
</li>
<li >
<a href="/articles/registry_mirror/">Run a local registry mirror</a>
</li>
<li >
<a href="/articles/host_integration/">Automatically starting containers</a>
</li>
<li >
<a href="/articles/baseimages/">Creating a base image</a>
</li>
<li >
<a href="/articles/dockerfile_best-practices/">Best practices for writing Dockerfiles</a>
</li>
<li >
<a href="/articles/certificates/">Using certificates for repository client verification</a>
</li>
<li >
<a href="/articles/using_supervisord/">Using Supervisor</a>
</li>
<li >
<a href="/articles/cfengine_process_management/">Process management with CFEngine</a>
</li>
<li >
<a href="/articles/puppet/">Using Puppet</a>
</li>
<li >
<a href="/articles/chef/">Using Chef</a>
</li>
<li >
<a href="/articles/dsc/">Using PowerShell DSC</a>
</li>
<li >
<a href="/articles/ambassador_pattern_linking/">Cross-Host linking using ambassador containers</a>
</li>
<li >
<a href="/articles/runmetrics/">Runtime metrics</a>
</li>
<li >
<a href="/articles/b2d_volume_resize/">Increasing a Boot2Docker volume</a>
</li>
<li >
<a href="/articles/systemd/">Controlling and configuring Docker using Systemd</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left active">
<a href="/reference/commandline/cli/">Reference</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/reference/commandline/cli/">Command line</a>
</li>
<li >
<a href="/reference/builder/">Dockerfile</a>
</li>
<li >
<a href="/faq/">FAQ</a>
</li>
<li >
<a href="/reference/run/">Run Reference</a>
</li>
<li class="active">
<a href="/reference/api/docker-io_api/">Docker Hub API</a>
</li>
<li >
<a href="/reference/api/registry_api/">Docker Registry API</a>
</li>
<li >
<a href="/reference/api/registry_api_client_libraries/">Docker Registry API Client Libraries</a>
</li>
<li >
<a href="/reference/api/hub_registry_spec/">Docker Hub and Registry Spec</a>
</li>
<li >
<a href="/reference/api/docker_remote_api/">Docker Remote API</a>
</li>
<li >
<a href="/reference/api/docker_remote_api_v1.16/">Docker Remote API v1.16</a>
</li>
<li >
<a href="/reference/api/docker_remote_api_v1.15/">Docker Remote API v1.15</a>
</li>
<li >
<a href="/reference/api/docker_remote_api_v1.14/">Docker Remote API v1.14</a>
</li>
<li >
<a href="/reference/api/docker_remote_api_v1.13/">Docker Remote API v1.13</a>
</li>
<li >
<a href="/reference/api/docker_remote_api_v1.12/">Docker Remote API v1.12</a>
</li>
<li >
<a href="/reference/api/docker_remote_api_v1.11/">Docker Remote API v1.11</a>
</li>
<li >
<a href="/reference/api/remote_api_client_libraries/">Docker Remote API Client Libraries</a>
</li>
<li >
<a href="/reference/api/docker_io_accounts_api/">Docker Hub Accounts API</a>
</li>
</ul>
</li>
<li class="dd_menu pull-left">
<a href="/contributing/contributing/">Contribute</a>
<ul class="dd_submenu" style="max-height: 75px;">
<li >
<a href="/contributing/contributing/">Contributing</a>
</li>
<li >
<a href="/contributing/devenvironment/">Development environment</a>
</li>
<li >
<a href="/contributing/docs_style-guide/">Documentation style guide</a>
</li>
</ul>
</li>
</ul>
<form id="nav_search" class="pull-right" action="/jsearch/">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<input name="q" id="tipue_search_input" type="text" class="search_input search-query ui-autocomplete-input" placeholder="Search the Docs" autocomplete="off">
</form>
</div>
</nav>
<div id="content" class="container">
<div class="row">
<div class="span3" id="leftnav">
<div id="toc_table">
<ul class="nav nav-tabs nav-stacked">
<li class=""><a href="#user-repository">User Repository</a></li>
<h3><a href="#create-a-user-repository">Create a user repository</a></h3>
<h3><a href="#delete-a-user-repository">Delete a user repository</a></h3>
<li class=""><a href="#library-repository">Library Repository</a></li>
<h3><a href="#create-a-library-repository">Create a library repository</a></h3>
<h3><a href="#delete-a-library-repository">Delete a library repository</a></h3>
<li class=""><a href="#user-repository-images">User Repository Images</a></li>
<h3><a href="#update-user-repository-images">Update user repository images</a></h3>
<h3><a href="#list-user-repository-images">List user repository images</a></h3>
<li class=""><a href="#library-repository-images">Library Repository Images</a></li>
<h3><a href="#update-library-repository-images">Update library repository images</a></h3>
<h3><a href="#list-library-repository-images">List library repository images</a></h3>
<li class=""><a href="#library-repository_1">Library Repository</a></li>
<h3><a href="#authorize-a-token-for-a-library">Authorize a token for a library</a></h3>
<li class=""><a href="#user-repository_1">User Repository</a></li>
<h3><a href="#authorize-a-token-for-a-user-repository">Authorize a token for a user repository</a></h3>
<li class=""><a href="#users">Users</a></li>
<h3><a href="#user-login">User Login</a></h3>
<h3><a href="#user-register">User Register</a></h3>
<h3><a href="#update-user">Update User</a></h3>
</ul>
</div>
</div>
<div class="span9 content-body">
<div id="versionnav" class="span3 pull-right invisible">
<ul class="nav version pull-right">
<li class="dropdown">
<a id="document-version-number" class="dropdown-toggle" data-toggle="dropdown" href="#">
Version v1.4
</a>
<ul id="documentation-version-list" class="dropdown-menu pull-right">
<li role="presentation" class="divider"></li>
<li> <a class="home-link3 tertiary-nav" href="https://github.com/docker/docker/blob/master/docs/sources/reference/api/docker-io_api.md" >Edit on GitHub</a></li>
</ul>
</li>
</ul>
</div>
<h1 id="docker-hub-api">Docker Hub API</h1>
<ul>
<li>This is the REST API for <a href="https://hub.docker.com">Docker Hub</a>.</li>
<li>Authorization is done with basic auth over SSL</li>
<li>Not all commands require authentication, only those noted as such.</li>
</ul>
<h1 id="repositories">Repositories</h1>
<h2 id="user-repository">User Repository</h2>
<h3 id="create-a-user-repository">Create a user repository</h3>
<p><code>PUT /v1/repositories/(namespace)/(repo_name)/</code></p>
<p>Create a user repository with the given <code>namespace</code> and <code>repo_name</code>.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/repositories/foo/bar/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
X-Docker-Token: true
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"}]
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>namespace</strong> the namespace for the repo</li>
<li><strong>repo_name</strong> the name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200
Vary: Accept
Content-Type: application/json
WWW-Authenticate: Token signature=123abc,repository="foo/bar",access=write
X-Docker-Token: signature=123abc,repository="foo/bar",access=write
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> Created</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active</li>
</ul>
<h3 id="delete-a-user-repository">Delete a user repository</h3>
<p><code>DELETE /v1/repositories/(namespace)/(repo_name)/</code></p>
<p>Delete a user repository with the given <code>namespace</code> and <code>repo_name</code>.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> DELETE /v1/repositories/foo/bar/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
X-Docker-Token: true
""
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>namespace</strong> the namespace for the repo</li>
<li><strong>repo_name</strong> the name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 202
Vary: Accept
Content-Type: application/json
WWW-Authenticate: Token signature=123abc,repository="foo/bar",access=delete
X-Docker-Token: signature=123abc,repository="foo/bar",access=delete
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> Deleted</li>
<li><strong>202</strong> Accepted</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active</li>
</ul>
<h2 id="library-repository">Library Repository</h2>
<h3 id="create-a-library-repository">Create a library repository</h3>
<p><code>PUT /v1/repositories/(repo_name)/</code></p>
<p>Create a library repository with the given <code>repo_name</code>.
This is a restricted feature only available to docker admins.</p>
<blockquote>
<p>When namespace is missing, it is assumed to be <code>library</code></p>
</blockquote>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/repositories/foobar/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
X-Docker-Token: true
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"}]
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>repo_name</strong> the library name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200
Vary: Accept
Content-Type: application/json
WWW-Authenticate: Token signature=123abc,repository="library/foobar",access=write
X-Docker-Token: signature=123abc,repository="foo/bar",access=write
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> Created</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active</li>
</ul>
<h3 id="delete-a-library-repository">Delete a library repository</h3>
<p><code>DELETE /v1/repositories/(repo_name)/</code></p>
<p>Delete a library repository with the given <code>repo_name</code>.
This is a restricted feature only available to docker admins.</p>
<blockquote>
<p>When namespace is missing, it is assumed to be <code>library</code></p>
</blockquote>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> DELETE /v1/repositories/foobar/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
X-Docker-Token: true
""
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>repo_name</strong> the library name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 202
Vary: Accept
Content-Type: application/json
WWW-Authenticate: Token signature=123abc,repository="library/foobar",access=delete
X-Docker-Token: signature=123abc,repository="foo/bar",access=delete
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> Deleted</li>
<li><strong>202</strong> Accepted</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active</li>
</ul>
<h1 id="repository-images">Repository Images</h1>
<h2 id="user-repository-images">User Repository Images</h2>
<h3 id="update-user-repository-images">Update user repository images</h3>
<p><code>PUT /v1/repositories/(namespace)/(repo_name)/images</code></p>
<p>Update the images for a user repo.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/repositories/foo/bar/images HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"}]
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>namespace</strong> the namespace for the repo</li>
<li><strong>repo_name</strong> the name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 204
Vary: Accept
Content-Type: application/json
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>204</strong> Created</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active or permission denied</li>
</ul>
<h3 id="list-user-repository-images">List user repository images</h3>
<p><code>GET /v1/repositories/(namespace)/(repo_name)/images</code></p>
<p>Get the images for a user repo.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> GET /v1/repositories/foo/bar/images HTTP/1.1
Host: index.docker.io
Accept: application/json
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>namespace</strong> the namespace for the repo</li>
<li><strong>repo_name</strong> the name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200
Vary: Accept
Content-Type: application/json
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"},
{"id": "ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds",
"checksum": "34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew"}]
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> OK</li>
<li><strong>404</strong> Not found</li>
</ul>
<h2 id="library-repository-images">Library Repository Images</h2>
<h3 id="update-library-repository-images">Update library repository images</h3>
<p><code>PUT /v1/repositories/(repo_name)/images</code></p>
<p>Update the images for a library repo.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/repositories/foobar/images HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"}]
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>repo_name</strong> the library name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 204
Vary: Accept
Content-Type: application/json
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>204</strong> Created</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active or permission denied</li>
</ul>
<h3 id="list-library-repository-images">List library repository images</h3>
<p><code>GET /v1/repositories/(repo_name)/images</code></p>
<p>Get the images for a library repo.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> GET /v1/repositories/foobar/images HTTP/1.1
Host: index.docker.io
Accept: application/json
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>repo_name</strong> the library name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200
Vary: Accept
Content-Type: application/json
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"},
{"id": "ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds",
"checksum": "34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew"}]
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> OK</li>
<li><strong>404</strong> Not found</li>
</ul>
<h1 id="repository-authorization">Repository Authorization</h1>
<h2 id="library-repository_1">Library Repository</h2>
<h3 id="authorize-a-token-for-a-library">Authorize a token for a library</h3>
<p><code>PUT /v1/repositories/(repo_name)/auth</code></p>
<p>Authorize a token for a library repo</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/repositories/foobar/auth HTTP/1.1
Host: index.docker.io
Accept: application/json
Authorization: Token signature=123abc,repository="library/foobar",access=write
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>repo_name</strong> the library name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200
Vary: Accept
Content-Type: application/json
"OK"
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> OK</li>
<li><strong>403</strong> Permission denied</li>
<li><strong>404</strong> Not found</li>
</ul>
<h2 id="user-repository_1">User Repository</h2>
<h3 id="authorize-a-token-for-a-user-repository">Authorize a token for a user repository</h3>
<p><code>PUT /v1/repositories/(namespace)/(repo_name)/auth</code></p>
<p>Authorize a token for a user repo</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/repositories/foo/bar/auth HTTP/1.1
Host: index.docker.io
Accept: application/json
Authorization: Token signature=123abc,repository="foo/bar",access=write
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>namespace</strong> the namespace for the repo</li>
<li><strong>repo_name</strong> the name for the repo</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200
Vary: Accept
Content-Type: application/json
"OK"
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> OK</li>
<li><strong>403</strong> Permission denied</li>
<li><strong>404</strong> Not found</li>
</ul>
<h2 id="users">Users</h2>
<h3 id="user-login">User Login</h3>
<p><code>GET /v1/users/</code></p>
<p>If you want to check your login, you can try this endpoint</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> GET /v1/users/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Authorization: Basic akmklmasadalkm==
</code></pre>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
OK
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>200</strong> no error</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active</li>
</ul>
<h3 id="user-register">User Register</h3>
<p><code>POST /v1/users/</code></p>
<p>Registering a new account.</p>
<p><strong>Example request</strong>:</p>
<pre class="prettyprint well"><code> POST /v1/users/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
{"email": "sam@docker.com",
"password": "toto42",
"username": "foobar"}
</code></pre>
<p>Json Parameters:</p>
<ul>
<li><strong>email</strong> valid email address, that needs to be confirmed</li>
<li><strong>username</strong> min 4 character, max 30 characters, must match
the regular expression [a-z0-9_].</li>
<li><strong>password</strong> min 5 characters</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 201 OK
Vary: Accept
Content-Type: application/json
"User Created"
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>201</strong> User Created</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
</ul>
<h3 id="update-user">Update User</h3>
<p><code>PUT /v1/users/(username)/</code></p>
<p>Change a password or email address for given user. If you pass in an
email, it will add it to your account, it will not remove the old
one. Passwords will be updated.</p>
<p>It is up to the client to verify that that password that is sent is
the one that they want. Common approach is to have them type it
twice.</p>
<p><strong>Example Request</strong>:</p>
<pre class="prettyprint well"><code> PUT /v1/users/fakeuser/ HTTP/1.1
Host: index.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Basic akmklmasadalkm==
{"email": "sam@docker.com",
"password": "toto42"}
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>username</strong> username for the person you want to update</li>
</ul>
<p><strong>Example Response</strong>:</p>
<pre class="prettyprint well"><code> HTTP/1.1 204
Vary: Accept
Content-Type: application/json
""
</code></pre>
<p>Status Codes:</p>
<ul>
<li><strong>204</strong> User Updated</li>
<li><strong>400</strong> Errors (invalid json, missing or invalid fields, etc)</li>
<li><strong>401</strong> Unauthorized</li>
<li><strong>403</strong> Account is not Active</li>
<li><strong>404</strong> User not found</li>
</ul>
</div>
</div>
</div>
<div id="push-footer"></div>
</div>
<div id="footer-container" class="container">
<div id="footer" class="grey-body">
<div class="row">
<div class="span2">
<span class="footer-title">Community</span>
<ul class="unstyled">
<li><a class="primary-button" href="https://www.docker.com/community/events/">Events</a></li>
<li><a class="primary-button" href="http://posts.docker.com">Friends' Posts</a></li>
<li><a class="primary-button" href="https://www.docker.com/community/meetups/">Meetups</a></li>
<li><a class="primary-button" href="https://www.docker.com/community/governance/">Governance</a></li>
<li><a class="primary-button" href="http://forums.docker.com">Forums</a></li>
<li><a class="primary-button" href="http://botbot.me/freenode/docker">IRC</a></li>
<li><a class="primary-button" href="https://github.com/docker/docker">GitHub</a></li>
<li><a class="primary-button" href="http://stackoverflow.com/search?q=docker">Stackoverflow</a></li>
<li><a class="primary-button" href="http://www.cafepress.com/docker">Swag</a></li>
</ul>
</div>
<div class="span2">
<span class="footer-title">Enterprise</span>
<ul class="unstyled">
<li><a class="primary-button" href="https://www.docker.com/enterprise/support/">Support</a></li>
<li><a class="primary-button" href="https://www.docker.com/enterprise/education/">Education</a></li>
<li><a class="primary-button" href="https://www.docker.com/enterprise/services/">Services</a></li>
</ul>
<span class="footer-title">Partner Solutions</span>
<ul class="unstyled">
<li><a class="primary-button" href="https://www.docker.com/partners/find/">Find a Partner</a></li>
<li><a class="primary-button" href="https://www.docker.com/partners/program/">Partner Program</a></li>
<li><a class="primary-button" href="https://www.docker.com/partners/learn/">Learn More</a></li>
</ul>
</div>
<div class="span2">
<span class="footer-title">Resources</span>
<ul class="unstyled">
<li><a class="primary-button" href="https://docs.docker.com">Documentation</a></li>
<li><a class="primary-button" href="https://www.docker.com/resources/help/">Help</a></li>
<li><a class="primary-button" href="https://www.docker.com/resources/usecases/">Use Cases</a></li>
<li><a class="primary-button" href="http://www.docker.com/tryit/">Online Tutorial</a></li>
<li><a class="primary-button" href="https://www.docker.com/resources/howtobuy/">How To Buy</a></li>
<li><a class="primary-button" href="http://status.docker.com">Status</a></li>
<li><a class="primary-button" href="https://www.docker.com/resources/security/">Security</a></li>
</ul>
</div>
<div class="span2">
<span class="footer-title">Company</span>
<ul class="unstyled">
<li><a class="primary-button" href="https://www.docker.com/company/aboutus/">About Us</a></li>
<li><a class="primary-button" href="https://www.docker.com/company/team/">Team</a></li>
<li><a class="primary-button" href="https://www.docker.com/company/news/">News</a></li>
<li><a class="primary-button" href="https://www.docker.com/company/press/">Press</a></li>
<li><a class="primary-button" href="https://www.docker.com/company/careers/">Careers</a></li>
<li><a class="primary-button" href="https://www.docker.com/company/contact/">Contact</a></li>
</ul>
</div>
<div class="span3">
<span class="footer-title">Connect</span>
<div class="search">
<span>Subscribe to our newsletter</span>
<form action="https://www.docker.com/subscribe_newsletter/" method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='aWL78QXQkY8DSKNYh6cl08p5eTLl7sOa' />
<tr><th><label for="id_email">Email:</label></th><td><input class="form-control" id="id_email" name="email" placeholder="Enter your email" type="text" /></td></tr>
<button type="submit"><i class="icon-arrow-right"></i> </button>
</form>
</div>
<ul class="unstyled social">
<li><a title="Docker on Twitter" class="primary-button blog" href="http://blog.docker.com">Blog</a></li>
<li><a title="Docker on Twitter" class="primary-button twitter" href="http://twitter.com/docker">Twitter</a></li>
<li><a title="Docker on Google+" class="primary-button googleplus" href="https://plus.google.com/u/0/communities/108146856671494713993">Google+</a></li>
<li><a title="Docker on Facebook" class="primary-button facebook" href="https://www.facebook.com/docker.run">Facebook</a></li>
<li><a title="Docker on Youtube" class="primary-button youtube" href="http://www.youtube.com/user/dockerrun">YouTube</a></li>
</ul>
<ul class="unstyled social">
<li><a title="Docker on SlideShare" class="primary-button slideshare" href="http://www.slideshare.net/Docker">Slideshare</a></li>
<li>
<a title="Docker on LinkedIn" class="primary-button" href="https://www.linkedin.com/company/docker">
<span class="linkedin"></span>
LinkedIn
</a>
</li>
<li>
<a title="Docker on GitHub" class="primary-button" href="https://github.com/docker/">
<span class="github"></span>
GitHub
</a>
</li>
<li>
<a title="Docker on Reddit" class="primary-button" href="http://www.reddit.com/r/docker">
<span class="reddit"></span>
Reddit
</a>
</li>
<li>
<a title="Docker on AngelList" class="primary-button" href="https://angel.co/docker-inc-1">
<span class="angellist"></span>
AngelList
</a>
</li>
</ul>
</div>
</div>
<div class="row clearfix">
<div class="span6 pagination-right copyright">
<span>&copy; 2014-2015 Docker, Inc.</span>
</div>
<div class="span6 pagination-left copyright">
<a href="http://www.docker.com/legal/terms_of_service">Terms</a> &middot;
<a href="http://www.docker.com/legal/privacy_policy">Privacy</a> &middot;
<a href="http://www.docker.com/legal/trademark_guidelines">Trademarks</a>
</div>
</div>
</div>
</div>
<script src="/js/jquery-1.10.2.min.js"></script>
<script src="/js/jquery.cookie.js" ></script>
<script src="/js/jquery-scrolltofixed-min.js"></script>
<script src="/js/bootstrap-3.0.3.min.js"></script>
<script src="/js/prettify-1.0.min.js"></script>
<script src="/js/dockerfile_tutorial.js"></script>
<script src="/js/dockerfile_tutorial_level.js"></script>
<script src="/js/base.js"></script>
<script src="/tipuesearch/tipuesearch_set.js"></script>
<script src="/tipuesearch/tipuesearch.min.js"></script>
<script type="text/javascript">
piAId = '45082';
piCId = '1482';
(function() {
function async_load(){
var s = document.createElement('script'); s.type = 'text/javascript';
s.src = ('https:' == document.location.protocol ? 'https://pi' : 'http://cdn') + '.pardot.com/pd.js';
var c = document.getElementsByTagName('script')[0]; c.parentNode.insertBefore(s, c);
}
if(window.attachEvent) { window.attachEvent('onload', async_load); }
else { window.addEventListener('load', async_load, false); }
})();
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#content').css("min-height", $(window).height() - 553 );
// if the URL contains a version string, update the version picker to reflect that
version = document.location.pathname.match(/^\/(v\d\.\d)\/.*/)
if (version && version[1]) {
$('#document-version-number')[0].text = 'Version '+version[1];
} else {
$('#document-version-number')[0].text = $('#document-version-number')[0].text + " (Latest)"
}
// load the complete versions list
$.get("/versions.html_fragment", function( data ) {
$('#documentation-version-list').prepend(data);
//remove any "/v1.1/" bits from front, so we can add the path to the version selection dropdown.
path = document.location.pathname.replace(/^\/v\d\.\d/, "");
$('#documentation-version-list a.version').each(function(i, e) {
e.href = e.href+path;
$(e).removeClass()
});
});
})
var userName = getCookie('docker_sso_username');
if (userName) {
$('.topmostnav_loggedout').hide();
$('.topmostnav_loggedin').show();
$('#logged-in-header-username').text(userName);
} else {
$('.topmostnav_loggedout').show();
$('.topmostnav_loggedin').hide();
}
</script>
</body>
</html>