Docker-Registry学习3-配置WebUI与客户端
停止并删除原来的registry
docker docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a9d6cba04f16 registry “/entrypoint.sh /etc…” 2 hours ago Up About an hour 0.0.0.0:5000->5000/tcp registry
➜ docker docker stop a9
a9
➜ docker docker rm a9
a9
➜ docker vim registry/docker-compose.yml
➜ docker cd registry
➜ registry ls
data
➜ registry vim docker-compose.yml
配置docker-registry-frontend
我们使用 docker-compose 来安装和运行,docker-compose.yml 配置如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 version: '3.1' services: registry: image: registry restart: always container_name: registry ports: - 5000 :5000 volumes: - /usr/ local/docker/ registry/data:/ var/lib/ registry frontend: image: konradkleine/docker-registry-frontend: v2 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 .75 .133 - ENV_DOCKER_REGISTRY_PORT=5000
启动容器
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ➜ registry docker-compose up -d Pulling frontend (konradkleine/docker-registry-frontend: v2)... v2: Pulling from konradkleine/docker-registry-frontend85 b1f47fba49: Pulling fs layere3c64813de17: Pulling fs layer6e61107884 ac: Pulling fs layer411 f14e0e0fd: Waiting987 d1071cd71: Waiting95913 db6ef30: Waiting1 eb7ee3fbde2: Pull complete9 b6f26b1b1a1: Pull completedaa6941a3108: Pull complete86 cc842193a6: Pull complete024 ab6890532: Pull completeaf9b7d0cb338: Pull complete02 f33fb0dcad: Pull completee8275670ee05: Pull complete1 c1a56903b01: Pull completeafc4e94602b9: Pull completedf1a95efa681: Pull completed8bcb7be9e08: Pull completed9c69b7bcc4f: Pull complete2 a14b209069e: Pull completee7c2bcdf63d5: Pull completeefc16e6bbbea: Pull complete552460069 ca8: Pull completee6b075740da3: Pull complete9976 bc800046: Pull completeDigest: sha256: 181 aad54ee64312a57f8ccba5247c67358de18886d5e2f383b8c4b80a7a5edf6Status: Downloaded newer image for konradkleine/docker-registry-frontend: v2Creating registry_frontend_1 ... done Creating registry ... done
查看结果
参考资料