Image registries

A registry stores images so that other machines can pull them. An image's name is its address: registry host, project, repository and tag, as in registry.shop.internal/shop/api:1.4.0.

How it works

docker push sends the layers the registry does not have yet, then a manifest that lists them; docker pull does the reverse. Without a host before the first slash, Docker means Docker Hub. docker tag adds a name to a local image, so the same image can be pushed under its registry name. Pushing requires being logged in (docker login) with the right to write in that project.

What breaks

An image that only exists on the CI server does not exist for production: docker images proves nothing until docker push has run. Pushing shop-api:1.4 goes to Docker Hub and is refused, a project you may not write to is refused too, and a typo in the registry host fails with no such host.

In a terminal

docker build -t registry.shop.internal/shop/api:1.4.0 api
docker push registry.shop.internal/shop/api:1.4.0
docker pull registry.shop.internal/shop/api:1.4.0

See it break, then fix it

Write the Dockerfile or the compose file, type the docker commands, and watch a simulated server run them through reboots, upgrades and traffic. Free to start.