在/usr/local/docker/registry下创建docker-compose.yml文件,填入下面的内容:
version: '3.1'
services:
registry:
image: registry
container_name: registry
restart: always
volumes:
- "/usr/local/docker/registry/data:/var/lib/registry"
ports:
- "5000:5000"
frontend:
image: konradkleine/docker-registry-frontend:v2
restart: always
ports:
- 8080:80
volumes:
- ./certs/frontend.crt:/etc/apache2/server.crt:ro
- ./certs/frontend.key:/etc/apache2/server.key:ro
environment:
- ENV_DOCKER_REGISTRY_HOST=192.168.171.130
- ENV_DOCKER_REGISTRY_PORT=5000
启动: docker-compose up -d