Running a Local Docker Registry with PowerShell
Setting up a local Docker registry is a great way to manage and share container images in your development environment without relying on external services like Docker Hub. This guide walks you through setting up a private Docker registry on your machine using PowerShell on Windows.
✅ Prerequisites
- Docker Desktop installed
- Windows PowerShell
- Optional:
curl
orInvoke-RestMethod
for testing
🏗️ Step 1: Start the Docker Registry Container
Docker provides an official image for the registry. You can launch it using PowerShell:
docker run -d `
-p 5000:5000 `
--restart=always `
--name registry `
registry:2
This will expose your registry at http://localhost:5000.
🧪 Step 2: Test the Registry
Let’s push a simple image to the local registry:
# Pull an example image
docker pull hello-world
# Tag it for the local registry
docker tag hello-world localhost:5000/hello-world
# Push it to the local registry
docker push localhost:5000/hello-world
#🔍 Step 3: Check Available Images To verify that the image was stored, run:
Invoke-RestMethod -Uri http://localhost:5000/v2/_catalog
{
"repositories": [
"hello-world"
]
}
Conclusion
With just a few commands, you can spin up your own private Docker registry for local development. It’s a great tool for testing, internal CI/CD workflows, or teams working in isolated environments.