Book Image

Developing with Docker

By : Jaroslaw Krochmalski, Jarosław Krochmalski
Book Image

Developing with Docker

By: Jaroslaw Krochmalski, Jarosław Krochmalski

Overview of this book

This fast-paced practical guide will get you up and running with Docker. Using Docker, you will be able to build, ship, and run many distributed applications in real time. You will start with quickly installing Docker and start working with images and containers. We will present different types of containers and their applications, and show you how to find and build images. You will learn how you can contribute to the image repository by publishing different images. This will familiarize you with the image building process and you will be able to successfully run your programs within containers. By finishing this book, you will be well equipped in deploying your applications using Docker and will have a clear understanding of concepts, techniques, and practical methods to get it running in production systems.
Table of Contents (16 chapters)
Developing with Docker
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Docker Hub and docker registry REST API


Let's discuss Docker Registry API and Docker Hub API and list the API endpoints related to searching and downloading the images. We will be using the command-line tool curl, but you can use any REST client of your choice, even your web browser.

First, let's check the status of the remote registry, by issuing a call to /_ping endpoint, by executing an HTTP GET:

curl -k https://registry.hub.docker.com/v1/_ping 

The registry will reply with a simple true value, that it's up and running.

First, we need to login or verify if we are logged in. Authorization is done with Basic Auth over SSL. To deal with user accounts, the API exposes the /users endpoint. Now, issue a GET on the following URL:

https://registry.hub.docker.com/v1/users

This will reply with an OK response if you are logged in or return the HTTP 401 Unauthorized status if you are not:

The Docker Hub API is not read-only, it also accepts POST requests. For example, you can register your new...