Add Docker registry server

This commit is contained in:
BatchAccount 1001 2022-12-03 15:22:05 +01:00
parent dcb05bf0d4
commit dee5a91333
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,17 @@
[Unit]
Description=Docker Compose Registry Application Service
Requires=docker.service
After=docker.service
[Service]
WorkingDirectory=/opt/registry
ExecStart=/usr/bin/docker-compose --project-name registry up
ExecStop=/usr/bin/docker-compose --project-name registry down
TimeoutStartSec=0
Restart=on-failure
StartLimitIntervalSec=60
StartLimitBurst=3
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,17 @@
version: '3'
services:
registry:
image: registry:2.8.1
ports:
- "5000:5000"
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_AUTH_HTPASSWD_PATH: /registry.password
volumes:
- data:/var/lib/registry
- ./registry.password:/registry.password
volumes:
data:

5
opt/registry/generate-pw.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
username="${1:?Missing username}"
docker run --rm -it alpine sh -c "apk add apache2-utils >/dev/null; htpasswd -Bn $username"