# Docker image explanation

In 
Published 2022-12-03

This tutorial explains to you what a Docker Image is. At the end of this article you will understand what a Docker image is.

If you want to create a Docker container on which you want to deploy something, you need to have a Docker image. A Docker image is a template used to create and launch a Docker container. A Docker image can contain a simple Linux installation or fully-configured enterprise software install, ready to run.

You can create a Docker image (Docker template) from another image (known as a base image). Also, you can create a Docker image from a Dockerfile or you create a Docker image from a Docker container.

If you have access to the Internet, you can download Docker images from the Docker Hub Repository.

In order to understand better how Docker is working, you can take a look at the article named What is Docker.

If you want to list Docker images you have into the local repository you have to use the docker images comand.

Here it is the syntax of this command:

docker images [OPTIONS] [REPOSITORY[:TAG]]

Options:

--all , -a --> Show all images (default hides intermediate images)

--digests --> Show digests

--filter , -f --> Filter output based on conditions provided

--format --> Pretty-print images using a Go template

--no-trunc --> Don't truncate output

--quiet , -q --> Only show numeric IDs

Example:

Here are more commands related to Docker images:

  • docker image build Build an image from a Dockerfile
  • docker image history Show the history of an image
  • docker image import Import the contents from a tarball to create a filesystem image
  • docker image inspect Display detailed information on one or more images
  • docker image load Load an image from a tar archive or STDIN
  • docker image ls List images
  • docker image prune Remove unused images
  • docker image pull Pull an image or a repository from a registry
  • docker image push Push an image or a repository to a registry
  • docker image rm Remove one or more images
  • docker image save Save one or more images to a tar archive (streamed to STDOUT by default)
  • docker image tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Enjoy working with Docker images and Docker containers !