Docker私服Registry的Linux下安装

 

配置文件docker-compose.yml

version: '3.1'
services:
  registry:
    image: registry
    restart: always
    container_name: registry
    ports:
      - 5000:5000
    volumes:
      - /usr/local/docker/registry/data:/var/lib/registry

访问

http://192.168.1.23/v2/

客户端(部署业务的机器)

修改/etc/docker/daemon.json

{
  "registry-mirrors": ["https://meu6mpwh.mirror.aliyuncs.com"],
  "insecure-registries": ["192.168.1.23:5000"]
}

重启docker服务
使用docker info检查是否生效

Labels:
Experimental: false
Insecure Registries:
 192.168.1.23:5000
 127.0.0.0/8
Registry Mirrors:
 https://meu6mpwh.mirror.aliyuncs.com/
Live Restore Enabled: false
Product License: Community Engine

WARNING: No swap limit support

Docker Registry WebUI

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:
      - 80: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.1.23
      - ENV_DOCKER_REGISTRY_PORT=5000

使用`http://192.168.1.23:80访问即可到仓库的前台

posted @ 2019-05-14 15:55  duniqb  阅读(358)  评论(0编辑  收藏  举报