🎓 A1Learner
🔍
0 of 50 lessons completed

What Is Docker Hub?

Docker Hub is the registry where Docker images are kept and shared. It holds official images, publisher images, and your own images, and docker pull fetches from it by default.

Pull an official image

This command pulls the official nginx image.

docker pull nginx:1.27-alpine

Search Hub

This command searches Hub for an image by name.

docker search nginx --limit 3

Example

docker pull nginx:1.27-alpine
docker images nginx --format "{{.Repository}}:{{.Tag}} {{.Size}}"

Key points

  • Registry: a store where images are kept by name and tag.
  • Docker Hub is the default registry for docker pull and docker run.
  • Official images are reviewed images from Docker, like nginx and postgres.
  • Publisher images come from the software's own vendor.
  • Check the image name, the publisher and the pull count before using an image.

In this example, Docker pulls the official nginx image from Docker Hub and lists it. The listing shows the repository, the tag and the size. The official name and tag are the checks that this image is the real one.

Note

Anyone can publish an image. A known publisher and a real tag are the safety checks.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

What is Docker Hub?