docker仓库快速搭建

通过docker-compose.yml搭建docker仓库,记录:

 

 

version: '3.1'
services:
  registry:
    image: registry
    restart: always
    container_name: registry
    environment:
      - user.timezone=GMT+08
    ports:
      - 5000:5000
    volumes:
      - /etc/localtime:/etc/localtime
      - /opt/bxy_registry:/var/lib/registry

#docker仓库web界面
  frontend:
    image: konradkleine/docker-registry-frontend:v2
    restart: always

#depends_on:对于此服务,先启动registry服务
    depends_on:
      - registry
    extra_hosts:
      bxy-registry: 172.17.31.68
    ports:
      - 8080:80
    volumes:
      - /etc/localtime:/etc/localtime
      - ./certs/frontend.crt:/etc/apache2/server.crt:ro
      - ./certs/frontend.key:/etc/apache2/server.key:ro
    environment:
      - user.timezone=GMT+08
      - ENV_DOCKER_REGISTRY_HOST=bxy-registry
      - ENV_DOCKER_REGISTRY_PORT=5000

posted @ 2019-10-18 12:02  黑崎一护有头屑  阅读(316)  评论(0编辑  收藏  举报