pull: Download an image from a registry to your local machine. docker run pulls automatically if the image is missing. docker pull downloads an image from a registry to your machine, such as docker pull postgres:16. docker run pulls automatically when the image is missing, so you mostly use pull to fetch a newer version explicitly.
Docker only downloads layers you do not already have, so pulling an update to an image you have used before is usually quick.
What should you keep in mind with pull?
Be specific with tags. docker pull postgres fetches latest, which can jump to a new major version without warning. A precise tag such as postgres:16.4 gives repeatable results. For private registries, log in first with docker login. On servers, pull the new image before stopping the old container, so the switch takes seconds instead of waiting for a download during downtime.
Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.
Use this skill when creating, modifying, or debugging Docker Compose configurations, even if the user just says they need to wire services together, add a database to their stack, or set up a local development environment with multiple containers. Covers service definitions, health checks, dependency ordering, volumes, networks, environment variables, and development overrides.
Use this skill when writing, reviewing, or optimizing Dockerfiles, even if the user just says their image is too large, their build is slow, or they need to harden a container for production. Covers multi-stage builds, layer caching, .dockerignore, non-root users, and image size optimization.