10 Docker Remote API Commands for Images – Flux7 Blog

By Flux7 Labs
July 3, 2014

In the last post of this series, we discussed Docker Remote API and explored the commands specific to containers. In this post, let’s discuss commands specific to images.

Create an Image

Images can be created in one of the following ways:

  • By performing a registry pull
  • By importing the image
POST /images/create

A sample request is shown in this screenshot.

 

Create an Image from a Container

To create an image from the container’s commits, use:

POST /commit

A sample request is in this screenshot.

 

List of Images

To obtain the list of images, use:

GET /images/json

A sample request is shown in this screenshot.

 

Insert a File

To insert a file at a specific path, use:

POST /images/(name)/insert

A sample request is shown in this screenshot.

 

Delete Image

To delete an image by name, use:

DELETE /images/(name)

A sample request is shown in this screenshot.

 

Registry Push

To push an image to the registry, use:

POST /images/(name)/push

A sample execution is shown in this screenshot.

 

Tag Image

To tag an image, use:

POST /images/(name)/tag

A sample execution is shown in this screenshot.

 

Search an Image

To search for an image, use:

GET /images/search

A sample execution is shown in this screenshot.

 

History

To view an image’s history, use:

GET /images/(name)/history

A sample execution is shown in this screenshot.

 

Build an Image

An image can be built with DockerFile using:

POST /build

A sample execution is shown in this screenshot.

 

We have now completed three legs of this Docker API journey. Check out the next post of this on-going Docker Tutorial Series, which you can find here every Thursday.

Get Started with AWS

Receive AWS tips, DevOps best practices, news analysis, commentary and more. Sign up for our IT Modernization blog here and set your topic and frequency preferences. Or, download our guide on getting started with AWS, establishing a secure AWS enterprise architecture with Flux7 Landing Zones.