Docker Images Intro

Docker containers are portable encapsulations of an environment to run applications. To run a container you need a Docker image. So, what is a docker image? It is an image is the specification or blueprint for creating a container. An image is really an immutable file, are built when the build command is run, and they produce a container when started with run. If you picture an image as a class, then the container is an instance of that class.

The docker cli gives you some commands out of the box to manage and inspect docker images:

# list most recently created images
> docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
<none>                <none>              8230cfbfab95        45 seconds ago      354MB

# delete a particular docker image. Replace 8230cfbfab95 with the image id
> docker rm 8230cfbfab95

# List all images with repository and their tag in a table format
> $ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}} "
IMAGE ID            REPOSITORY                TAG
77af4d6b9913        <none>                    <none>

Read more about Docker images. Read more about the docker cli images commands

Instagram Post