Docker registry image that supports configurable authentication via environment variables
10K+
A Docker Registry v3 image with built-in HTTP basic authentication using htpasswd.
This project provides a ready-to-use Docker image that extends the official Docker Registry (version 3) with HTTP basic authentication. It automatically configures htpasswd-based authentication using environment variables, making it easy to deploy a secure, private Docker registry.
user@local $ docker run -d \
-p 5000:5000 \
-e REGISTRY_USER=myuser \
-e REGISTRY_PASSWORD=mypassword \
--name registry \
mittwald/registry:3
user@local $ mw container run \
-p 5000:5000 \
-e REGISTRY_USER=myuser \
-e REGISTRY_PASSWORD=mypassword \
--name registry \
mittwald/registry:3
REGISTRY_USER: The username for registry authenticationREGISTRY_PASSWORD: The password for registry authenticationREGISTRY_AUTH_HTPASSWD_REALM: The realm name for authentication (default: "Registry Realm")All standard Docker Registry environment variables are also supported. See the official Docker Registry documentation for more options.
Once the registry is running with authentication, you'll need to log in before pushing or pulling images. The examples assume your registry is running in the mittwald cloud, and that you have connected your registry container to a subdomain of the default p-XXXXXX.project.space subdomain.
# Log in to the registry
docker login registry.p-XXXXXX.project.space
# Tag an image
docker tag myimage:latest registry.p-XXXXXX.project.space/myimage:latest
# Push the image
docker push registry.p-XXXXXX.project.space/myimage:latest
# Pull the image
docker pull registry.p-XXXXXX.project.space/myimage:latest
To build the image yourself:
docker build -t mittwald/registry:3 .
The auth-entrypoint.sh script:
REGISTRY_USER and REGISTRY_PASSWORD are setThis project is licensed under the MIT License - see the LICENSE file for details.
Content type
Image
Digest
sha256:7934d68a4…
Size
22.7 MB
Last updated
about 17 hours ago
docker pull mittwald/registry