Images

So a “container” is like a lightweight VM… so what’s an image?

  • Image: A read-only definition of a container
  • Container: An instance of a virtualized read-write environment

A container is basically an image that’s actively running. In other words, you boot up a container from an image. You can create multiple separate containers all from the same image (it’s kind of like the relationship between classes and objects in programming).

Pulling and Viewing Images

You can download an image from Docker Hub to your local machine using the docker pull command. This copies the image file down so you won’t have to download it later when you want to use it.

# Example: Pull the getting-started image
docker pull docker/getting-started

To view all the images you have saved locally, use the docker images command:

docker images

You can also view your images in the Docker Desktop app under the “Images” tab.