Flux7 DevOps Blog

10 Docker Remote API Commands for Images - Flux7 Blog

Jul 3, 2014 12:00:00 PM Flux7 Labs Docker, Docker Tutorials, Time to market

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

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.

docker-create-image-from-container

List of Images

To obtain the list of images, use:

GET /images/json

A sample request is shown in this screenshot.

docker-list-images

Insert a File

To insert a file at a specific path, use:

POST /images/(name)/insert

A sample request is shown in this screenshot.

docker-image-insert-file

Delete Image

To delete an image by name, use:

DELETE /images/(name)

A sample request is shown in this screenshot.

delete-an-image

Registry Push

To push an image to the registry, use:

POST /images/(name)/push

A sample execution is shown in this screenshot.

docker-push-image-to-remote-repo

Tag Image

To tag an image, use:

POST /images/(name)/tag

A sample execution is shown in this screenshot.

tag-an-image

Search an Image

To search for an image, use:

GET /images/search

A sample execution is shown in this screenshot.

docker-search-an-image

History

To view an image’s history, use:

GET /images/(name)/history

A sample execution is shown in this screenshot.

docker-get-image-history

Build an Image

An image can be built with DockerFile using:

POST /build

A sample execution is shown in this screenshot.

docker-build-image-from-dockerfile

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. 

Get Started Guide

Written by Flux7 Labs

Flux7 is the only Sherpa on the DevOps journey that assesses, designs, and teaches while implementing a holistic solution for its enterprise customers, thus giving its clients the skills needed to manage and expand on the technology moving forward. Not a reseller or an MSP, Flux7 recommendations are 100% focused on customer requirements and creating the most efficient infrastructure possible that automates operations, streamlines and enhances development, and supports specific business goals.

Subscribe to Flux7's Blog

Posts by Topic

see all

Recent Posts