Snippets

Learning.com Docker compose image registry

Created by David Hogue
# Start the registry
docker run -d -p 6000:5000 --restart=always --name registry registry:2

# Example: tag a single image and push to registry
docker tag teacherclient-nginx:latest localhost:6000/teacherclient-nginx
docker push localhost:6000/teacherclient-nginx

# Use the registry from docker-compose
SET DOCKER_REGISTRY=localhost:6000/
echo %DOCKER_REGISTRY%
docker-compose up -d
docker-compose push

# Remove local images
docker-compose down
docker image prune -a
docker image ls

# Rerun docker-compose using images from registry
docker-compose up -d

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.