Docker Image commands

The following are the some of the Docker Image Commands that are widely used:

List Docker Images

docker images

Example:

$ docker ls

REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 0d9c6c5575f5 4 days ago 126MB
ubuntu 18.04 47b199b0cb85 2 weeks ago 64.2MB

Pull an Docker Image From a Registry

docker image pull <image-name>

Example:

$ docker pull alpine:3.11

3.11: Pulling from library/alpine
Digest: sha256:9f11a34ef1c67e073069f13b09fb76dc8f1a16f7067eebafc68a5049bb0a072f
Status: Downloaded newer image for alpine:3.11

Docker Images Prune

  • The Docker Image Prune will remove the unused Docker Images that are not associated with any containers. The Command looks as follows:
docker image prune

Docker Images Filter

  • When we want to filter some specific images we can filter out them using its labels or its meta information tags with the option –filter. The command looks as follows:
docker image ls -f "reference=mypython-app"

 Remove an Image from Docker

  • The following command is used for removing the docker image from the local registry:
docker rmi <id-of-image>

Example:

$ docker rmi <image_id>

Untagged: <image_id>
Deleted: sha256:<image_id>

 Searching for a specific image on Docker Hub

docker search ubuntu

Example:

$ docker search ubuntu

NAME                             DESCRIPTION                                                          STARS                 OFFICIAL                          AUTOMATED

ubuntu                           Ubuntu is a Debian-based Linux operating s…                4458                    [OK]               

ubuntu-upstart              Upstart is an event-based replacement for …                  62                         [OK]               

tutum/ubuntu                 Simple Ubuntu docker images with ssh access             49                          [OK]               

ansible/ubuntu14.04-ansible

What is Docker Image?

Docker Image is an executable package of software that includes everything needed to run an application. This image informs how a container should instantiate, determining which software components will run and how. Docker Container is a virtual environment that bundles application code with all the dependencies required to run the application. The application runs quickly and reliably from one computing environment to another.

Table of Content

  • What is Docker Image?
  • SubCommands of Docker Image
  • Docker Image Prune
  • Docker Image Build
  • Docker Image Tag
  • Uses of Docker Images
  • Difference between Docker Image VS Docker Container
  • Structure Of Docker Image 
  • How To Create A Docker Image And Run It As Container?
  • How to Build Docker Python Images? A Step-By-Step Guide
  • Docker Image commands
  • Docker Images – FAQs

Similar Reads

What is Docker Image?

Docker images are built using the Dockerfile which consists of a set of instructions that are required to containerize an application. The docker image includes the following to run a piece of software. A docker image is a platform-independent image that can be built in the Windows environment and it can be pushed to the docker hub and pulled by others with different OS environments like Linux....

SubCommands of Docker Image

The following are the some of the sub commands that are used with Docker Image:...

Docker Image Prune

Docker image prune is a command used in the docker host to remove the images that are not used or Docker image prune command is used to remove the unused docker images....

Docker Image Build

The Following is the command which is used to build the docker image....

Docker Image Tag

Docker tags are labels for container images, used to differentiate versions and variants of an image during development and deployment. Docker tags will help you identify the various versions of docker images and help distinguish between them. Docker image will help us to build continuous deployment very quickly...

Uses of Docker Images

The following are the uses of Docker Images:...

Difference between Docker Image VS Docker Container

The following are the difference between Docker Image and Docker Container:...

Structure Of Docker Image

The layers of software that make up a Docker image make it easier to configure the dependencies needed to execute the container....

How To Create A Docker Image And Run It As Container?

Follow the below steps to create a Docker Image and run a Container:...

How to Build Docker Python Images? A Step-By-Step Guide

Step 1: Create A Dockerfile...

Docker Image commands

The following are the some of the Docker Image Commands that are widely used:...

Docker Images – FAQs

What is Docker Image VS Docker Container?...