*说明:ZCBUS 软件通过docker-compose对zcbus server、zcbus web、mysql、kafka容器进行编排,实现单机软件部署,可用于测试环境。
*

一、环境配置

配置私有镜像仓库,镜像从镜像仓库进行拉去
配置方法:

  • Linux环境的配置
  • MacOS 环境配置

1. Linux 环境配置

hosts文件添加

# hosts文件添加:
47.93.83.53  reg.zcbus.com reg.zbomc.com

/etc/docker/daemon.json 中添加允许不安全仓库访问

# daemon.json
[oracle@interface ~]$ cat /etc/docker/daemon.json 
{
  "registry-mirrors": [
    "http://hub-mirror.c.163.com"
  ],
  "insecure-registries": [
    "reg.zcbus.com","47.93.83.53","reg.zbomc.com"
  ]
}

重启docker

systemctl stop docker 
systemctl start docker 

测试拉取镜像

[root@interface docker]# docker pull reg.zbomc.com/zcbus_web/zcbus_web:v3.0.4
v3.0.4: Pulling from zcbus_web/zcbus_web
a4a2a29f9ba4: Downloading [>                                                  ]    286kB/28.56MB
127c9761dcba: Download complete 
d13bf203e905: Download complete 
4039240d2e0b: Download complete 
92dacb5704bc: Waiting 
bd88509fd9cd: Waiting 
a4a2a29f9ba4: Downloading [=>                                                 ]  572.7kB/28.56MB
be203a545060: Waiting 
1d4ebe2d550f: Waiting 
dd30f863b4d5: Waiting 
a903970e7bdf: Waiting 
bd88509fd9cd: Downloading [>                                                  ]  507.2kB/50.71MB

如果可以进行以上拉取操作,则可以访问私有镜像仓库

2. mac 环境配置

sudo vi /etc/hosts
47.93.83.53  reg.zcbus.com reg.zbomc.com

配置镜像仓库


修改完成后点击Apply&Restart 。

测试

二、配置docker-compose.yml【执行docker-compose目录下】

version: '2'
services:
  zcbusdb:
    image: reg.zbomc.com/zcbus_mysql/zcbus_mysql:v3.0.5
    privileged: true
    restart: always
    expose:
      - 3306
    volumes:
         - /usr/local/docker/mysql/data:/var/lib/mysql #前面是本地目录 后面是映射到容器内的目录
         - /usr/local/docker/mysql/logs:/var/log/mysql
    container_name: zcbusdb
  zcbuskafka:
    image: reg.zbomc.com/zcbus_kafka/kafka:2.12-2.4.0
    privileged: true
    restart: always
    environment:
      LANG: C.UTF-8
    depends_on:
      - zcbusdb
    ports:
      - "9092:9092"
      - "2181:2181"
    volumes:
         - /usr/local/docker/kafka/data:/usr/local/kafka/data   
    container_name: zcbuskafka
  zcbusweb:
    image: reg.zbomc.com/zcbus_web/zcbus_web:v3.0.4
    restart: always
    environment:
      LANG: C.UTF-8
    depends_on:
      - zcbusdb
    ports:
      - "8888:8888"
    container_name: zcbusweb
  zcbusserver:
    image: reg.zbomc.com/zcbus_server/zcbus_server:v3.0.5
    restart: always
    environment:
      LANG: C.UTF-8
      dbuser: "SFVVTjo"
      dbpwd: 'SFVVTjo'
      dbhost: zcbusdb
      dbport: 3306
      database: "zcbus"
    depends_on:
      - zcbusdb
      - zcbuskafka
    container_name: zcbusserver

启动

docker-compose up -d 
文档更新时间: 2020-12-28 20:56   作者:admin