The REST API for Docker Hub

Docker Hub provides a REST API to integrate the Hub capabilities through programs. The REST API is supported for both user and repository management.

User management supports the following features:

  • User Login: This is used for user login to Docker Hub:
      GET /v1/users 
$ curl --raw -L --user vinoddandy:password
https://index.docker.io/v1/users
4
"OK"
0
  • User Register: This is used for the registration of a new user:
      POST /v1/users 
  • Update user: This is used to update the user's password and e-mail:
      PUT /v1/users/(username)/ 

Repository management supports the following features:

  • Create a user repository: This creates a user repository:
      PUT /v1/repositories/(namespace)/(repo_name)/ 
$ curl --raw -L -X POST --post301 -H
"Accept:application/json" -H "Content-Type:
application/json" --data-ascii '{"email":
"[email protected]", "password": "password",
"username": "singhvinod494" }'
https://index.docker.io/v1/users
e
"User created"
0

After you create repositories, your repositories will be listed here, as shown in this screenshot:

  • Delete a user repository: This deletes a user repository:
      DELETE /v1/repositories/(namespace)/(repo_name)/ 
  • Create a library repository: This creates a library repository, and it is available only to Docker administrators:
      PUT /v1/repositories/(repo_name)/ 
  • Delete a library repository: This deletes a library repository, and it is available only to Docker administrators:
      DELETE /v1/repositories/(repo_name)/ 
  • Update user repository images: This updates the images of a user's repository:
      PUT /v1/repositories/(namespace)/(repo_name)/images 
  • List user repository images: This lists the images in a user's repository:
      GET /v1/repositories/(namespace)/(repo_name)/images 
  • Update library repository images: This updates the images in a library repository:
      PUT /v1/repositories/(repo_name)/images 
  • List library repository images: This lists the images in a library repository:
      GET /v1/repositories/(repo_name)/images 
  • Authorize a token for a library repository: This authorizes a token for a library repository:
      PUT /v1/repositories/(repo_name)/auth 
  • Authorize a token for a user repository: This authorizes a token for a user's repository:
      PUT /v1/repositories/(namespace)/(repo_name)/auth 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset