Private Docker registry
Topic: Containers core
Summary
Run a private Docker registry with the official registry image. Push and pull with docker tag and docker push. Use when you need to store images privately or in CI.
Intent: How-to
Quick answer
- Run registry with docker run -d -p 5000:5000 registry:2. Use HTTPS and auth in production.
- Tag image for registry then push. Pull from other hosts after docker login.
- Use volume for storage. Configure TLS and authentication for production.
Prerequisites
Steps
-
Run registry
docker run -d -p 5000:5000 -v regdata:/var/lib/registry registry:2. Add TLS and auth for production.
-
Push and pull
docker tag app localhost:5000/app. docker push localhost:5000/app. From another host use hostname and login.
-
Verify
Pull image from registry and run. Confirm images listed in registry storage.
Summary
Run registry container; tag and push images; pull from other hosts. Use TLS and auth in production.
Prerequisites
Steps
Step 1: Run registry
Start registry with volume; add TLS and auth for production.
Step 2: Push and pull
Tag with registry host; push; pull from other hosts after login.
Step 3: Verify
Pull and run; confirm registry lists images.
Verification
- Images push and pull; registry shows them.
Troubleshooting
Push denied — Configure auth. TLS errors — Use valid certs and hostname.