# 搭建portainer
docker run -d --restart always --name portainer \
--net caddy-network \
-v /var/run/docker.sock:/var/run/docker.sock -v $dockerVolume/portainer:/data portainer/portainer-ee:latest
# 创建密码
mkdir -p $dockerVolume/registry/auth
docker run \
--entrypoint htpasswd \
httpd:2 -Bbn username password > $dockerVolume/registry/auth/htpasswd
# 搭建registry
docker run -d --restart always --name registry \
--net caddy-network \
-v $dockerVolume/registry/data:/var/lib/registry \
-v $dockerVolume/registry/auth:/auth \
-e "REGISTRY_AUTH=htpasswd" \
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
registry:2