Book Image

Learning Docker

By : Pethuru Raj, Jeeva S. Chelladhurai, Vinod Singh, Vinod kumar Singh, Jeeva Chelladhurai, Pethuru Raj Chelliah
Book Image

Learning Docker

By: Pethuru Raj, Jeeva S. Chelladhurai, Vinod Singh, Vinod kumar Singh, Jeeva Chelladhurai, Pethuru Raj Chelliah

Overview of this book

Table of Contents (18 chapters)
Learning Docker
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The REST APIs for the Docker Hub


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

User management supports the following features:

  • User Login: This is used for user login to the 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 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/(usename)/

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...