Add Docker registry server
This commit is contained in:
parent
dcb05bf0d4
commit
dee5a91333
|
@ -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
|
||||||
|
|
|
@ -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:
|
|
@ -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"
|
Loading…
Reference in New Issue