You can only push images to a registry if the image tag matches the registry domain. The process for tagging and pushing is the same as with Docker Hub, but you need to explicitly include the local registry domain in the new tag. These commands pull the registry server image from Docker Hub and add a new tag, making it suitable to be pushed to the local registry:
docker image pull dockeronwindows/ch04-registry
docker image tag dockeronwindows/ch04-registry registry.local:5000/infrastructure/registry:v2.6.1
In the docker image tag command, you can change every part of the image name for the new tag. I've used the following:
- registry.local:5000 the registry domain. The original image name had an implied domain of docker.io.
- infrastructure the account name. The original account name was dockeronwindows.
- registry the repository...