- create a separated volume for docker image data
- mount volume to /docker-mnt directory
mkdir -p /docker-mnt/auth
mkdir -p /docker-mnt/data
docker run --entrypoint htpasswd httpd:2 -Bbn <username> <password> > /docker-mnt/auth/htpasswd
# e.g. if you want to serve your private registry at registry.example.com
SUBDOMAIN=<registry> URL=<exmaple.com> PUBLIC_IP=<X.X.X.X> STAGING=true docker compose up -d
See more details in the comments of
docker-compose.yaml
- Only support single subdomain, which is usually enough