🎓 A1Learner
🔍
0 of 50 lessons completed

Private Registries and Image Tags

A private registry keeps images for one team instead of the public. Other registries work like Hub, and image scanning checks a pushed image for known flaws.

Tag for a registry

The tag starts with the registry address.

docker tag greet:1.0 my-registry.example.com/team/greet:1.0

Push to it

The push uploads to the named registry.

docker push my-registry.example.com/team/greet:1.0

Example

docker run -d --name g6-reg -p 8115:5000 registry:2 >/dev/null
sleep 2
docker tag g4-greet:1.0 localhost:8115/team/greet:1.0
docker push localhost:8115/team/greet:1.0

Key points

  • Private registry: a registry only your team can read, like a company Hub.
  • Other registries include cloud registries and a local registry container.
  • A registry address in the tag chooses where the image goes.
  • Scan an image after pushing it, to catch known flaws before use.
  • Use exact version tags for releases, and latest only as a pointer.

In this example, a local registry stands in for a private registry. The image is tagged with the registry address and a team path, then pushed. The push proves the tag chose the registry, and a private registry takes the same commands.

Note

A private image still needs its tag. The registry address and the tag together name the image.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

How does a tag choose which registry an image goes to?