Skip to content

Instantly share code, notes, and snippets.

@Hiweus
Created February 7, 2025 23:24
Show Gist options
  • Save Hiweus/49634b9d2331cc181cfde0e3ca96e5b9 to your computer and use it in GitHub Desktop.
Save Hiweus/49634b9d2331cc181cfde0e3ca96e5b9 to your computer and use it in GitHub Desktop.
Hosting a docker register

Docker register

This command will host a docker register

docker run -d -p 5000:5000 -v ./register/images:/var/lib/registry -v ./certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain.pem -e REGISTRY_HTTP_TLS_KEY=/certs/privkey.pem --restart on-failure --name myregistry registry

Build and push

To push image to this register you need to tag the image as <url>/<image_name>:<tag> where tag is optional.

 docker build -t localhost:5000/my-image:latest .
 docker push localhost:5000/my-image:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment