Skip to main content

How to Download a Docker Image with docker pull

· 3 min read
Jagdish Kumawat
Founder @ Dewiride

Before Docker can run a container, it needs the image, and most images come from Docker Hub. docker pull downloads one ahead of time, so the first run starts at once. This guide pulls the small alpine image, with real output from Docker 29.9.3.

Syntax​

Syntax
docker pull NAME:TAG
PartWhat it means
NAMEThe image, such as alpine or nginx
TAGThe version, such as 3.24. Without it, Docker pulls latest

The reference describes docker pull as "Download an image from a registry", and: "If no tag is provided, Docker Engine uses the :latest tag as a default." The same command works in PowerShell.

Prerequisites​

  • Docker: Docker Desktop on Mac or Windows, running.

Step 1: Pull an Image​

Terminal
docker pull alpine:3.24
Output
3.24: Pulling from library/alpine
b90627b8f429: Already exists
Digest: sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf
Status: Downloaded newer image for alpine:3.24
docker.io/library/alpine:3.24

docker pull alpine:3.24's output in a terminal: Pulling from library/alpine, one layer that already exists, the digest, and Status: Downloaded newer image for alpine:3.24.

  • The layer line: images are made of layers. This one said Already exists because another image on this computer shares it; a layer Docker has to download says Pull complete.
  • Digest: the image's unique fingerprint.
  • Status: Downloaded newer image: the image is now on this computer, named alpine:3.24.

Step 2: Pull It Again​

Terminal
docker pull alpine:3.24
Output
3.24: Pulling from library/alpine
Digest: sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf
Status: Image is up to date for alpine:3.24
docker.io/library/alpine:3.24

The second docker pull alpine:3.24 in a terminal: the same digest and Status: Image is up to date for alpine:3.24.

Nothing to download: the local copy matches Docker Hub's.

Common Mistakes​

MistakeWhat happensDo this instead
A tag that doesn't existError response from daemon: manifest for alpine:3.99 not found: manifest unknown: manifest unknownCheck the image's tags on Docker Hub
Leaving the tag outDocker pulls latest, which moves to new versions over timePull a fixed tag, such as alpine:3.24, when you need the same image every time

Troubleshooting​

SymptomLikely causeFix
manifest unknownThe name or the tag is misspelled or doesn't existCorrect it, or pull without a tag to get latest

FAQ​

Do I have to pull before docker run?​

No: docker run pulls a missing image itself. Pulling first only moves the download to a time you choose.

Where do pulled images go?​

Into Docker's own image storage. docker images lists them, with their sizes.

Conclusion​

docker pull alpine:3.24 downloaded the image, and pulling it again said Image is up to date. Pull a fixed tag when you need the same image every time.

Additional Resources​