More Docker. Easy Access. New Streamlined Plans. Learn more.

What is an image?

Explanation

Seeing a container is an isolated process, where does it get its files and configuration? How do you share those environments?

That's where container images come in. A container image is a standardized package that includes all of the files, binaries, libraries, and configurations to run a container.

For a PostgreSQL image, that image will package the database binaries, config files, and other dependencies. For a Python web app, it'll include the Python runtime, your app code, and all of its dependencies.

There are two important principles of images:

  1. Images are immutable. Once an image is created, it can't be modified. You can only make a new image or add changes on top of it.

  2. Container images are composed of layers. Each layer represents a set of file system changes that add, remove, or modify files.

These two principles let you to extend or add to existing images. For example, if you are building a Python app, you can start from the Python image and add additional layers to install your app's dependencies and add your code. This lets you focus on your app, rather than Python itself.

Finding images

Docker Hub is the default global marketplace for storing and distributing images. It has over 100,000 images created by developers that you can run locally. You can search for Docker Hub images and run them directly from Docker Desktop.

Docker Hub provides a variety of Docker-supported and endorsed images known as Docker Trusted Content. These provide fully managed services or great starters for your own images. These include:

  • Docker Official Images - a curated set of Docker repositories, serve as the starting point for the majority of users, and are some of the most secure on Docker Hub
  • Docker Verified Publishers - high-quality images from commercial publishers verified by Docker
  • Docker-Sponsored Open Source - images published and maintained by open-source projects sponsored by Docker through Docker's open source program

For example, Redis and Memcached are a few popular ready-to-go Docker Official Images. You can download these images and have these services up and running in a matter of seconds. There are also base images, like the Node.js Docker image, that you can use as a starting point and add your own files and configurations.

Try it out


In this hands-on, you will learn how to search and pull a container image using the Docker Desktop GUI.

Search for and download an image

  1. Open the Docker Desktop Dashboard and select the Images view in the left-hand navigation menu.

    A screenshot of the Docker Desktop Dashboard showing the image view on the left sidebar
  2. Select the Search images to run button. If you don't see it, select the global search bar at the top of the screen.

    A screenshot of the Docker Desktop Dashboard showing the search ta
  3. In the Search field, enter "welcome-to-docker". Once the search has completed, select the docker/welcome-to-docker image.

    A screenshot of the Docker Desktop Dashboard showing the search results for the docker/welcome-to-docker image
  4. Select Pull to download the image.

Learn about the image

Once you have an image downloaded, you can learn quite a few details about the image either through the GUI or the CLI.

  1. In the Docker Desktop Dashboard, select the Images view.

  2. Select the docker/welcome-to-docker image to open details about the image.

    A screenshot of the Docker Desktop Dashboard showing the images view with an arrow pointing to the docker/welcome-to-docker image
  3. The image details page presents you with information regarding the layers of the image, the packages and libraries installed in the image, and any discovered vulnerabilities.

    A screenshot of the image details view for the docker/welcome-to-docker image

In this walkthrough, you searched and pulled a Docker image. In addition to pulling a Docker image, you also learned about the layers of a Docker Image.

Additional resources

The following resources will help you learn more about exploring, finding, and building images:

Next steps

Now that you have learned the basics of images, it's time to learn about distributing images through registries.