docker images

See which images are on your machine, download one with docker pull, pick a version by its tag, and clean up with docker rmi.

>_ Try it: a simulated Linux, right here
Loading the terminal…

Examples

  • docker pull redis
  • docker pull redis:7
  • docker images
  • docker images redis
  • docker rmi redis:7
  • docker images -q

How it works

An image is the read-only template a container starts from (nginx, postgres, your own app). docker images lists the ones on your machine, with their tag (version) and size.

docker pull NAME:TAG downloads one from Docker Hub; without a tag you get latest. docker run pulls by itself when the image is missing.

Syntax

docker images [-q] [REPOSITORY[:TAG]]

Options

OptionWhat it does
REPOSITORY[:TAG]only that image (and tag)
-qonly the image IDs
docker pulldownload an image
docker rmidelete an image

Good to know

  • Pin versions in real projects (postgres:16, not postgres): latest changes under your feet.
  • An image used by a container (even a stopped one) can't be removed: docker rm the container first.