Thuta Learning
BasicDevOps & Toolsintermediate

docker pull

Relax. We'll talk through this in plain words — no textbook voice.

docker pull downloads an image from Docker Hub or another registry onto your local machine. docker run will auto-pull an image if it isn't present, but if you want tight control over the version, it's better to run pull yourself.

dockerfile
# Pull the latest Ubuntu image
docker pull ubuntu

# Pull a specific version tag
docker pull node:20-alpine

# Pull a lightweight Nginx image
docker pull nginx:alpine

ubuntu without writing a tag, it defaults to pulling the latest tag. If you want your project to be reproducible, it's better to pin a version tag, like node:20-alpine.

You should see
You'll see the image layers downloading in the terminal, and once it's done, the image will be ready to use locally.

Info

latest doesn't mean the best version forever. Over time the image version can change, and your project's behavior might change with it.

Easy traps

  • A poor internet connection, missing registry login, or a mistyped image name can all cause pull to fail. Double-check the image name and tag.