Skip to main content

What is a Docker Repository?

A Docker Repository is a section inside a Docker Registry where versions of one and the same image are stored. Each version of such an image has its own tag.

To draw an analogy:

  • a Registry is the whole of GitHub
  • a Repository is a specific repository on GitHub
  • Tags are the versions inside a repository

What this looks like as an example

Docker Hub has the repository:

javascript
library/nginx

Inside it there can be tags:

javascript
nginx:latest nginx:1.25 nginx:alpine nginx:stable

All these tags belong to one repository, because they are all different versions of the same nginx image.

Commands that work with it

  • docker pull nginx - download the image (defaults to latest)
  • docker pull nginx:alpine - download a specific tag from the repository
  • docker push myrepo/app:1.0 - push a version of an image to your own repository

Summary

A Docker Repository is a storage location for the versions of one image inside a Docker Registry. A Registry can contain many repositories, and each repository can contain many image tags.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.