下载镜像

docker pull zouyapeng/zabbix-3.0
docker pull zouyapeng/zabbix-db-mariadb

安装docker-compose

方法一:

curl -L https://github.com/docker/compose/releases/download/1.7.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
 
chmod +x /usr/local/bin/docker-compose

方法二:

pip install docker-compose

编写docker-compose.yml

直接下载修改:docker-compose.yml

zabbix-db:
  image: zouyapeng/zabbix-db-mariadb
  container_name: zabbix-db
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /opt/volumes/mysql/mysql:/var/lib/mysql
  environment:
    - MARIADB_USER=zabbix
    - MARIADB_PASS=zabbix
 
zabbix-server:
  image: zouyapeng/zabbix-3.0:latest
  container_name: zabbix
  ports:
    - "80:80"
    - "10051:10051"
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /opt/volumes/zabbix/alertscripts:/usr/local/share/zabbix/alertscripts
  links:
    - zabbix-db:zabbix.db
  environment:
    - ZS_DBHost=zabbix.db
    - ZS_DBUser=zabbix
    - ZS_DBPassword=zabbix
    - ZW_ZBX_SERVER=localhost
    - ZW_ZBX_SERVER_NAME=ZBXS

启动服务

docker-compose up -d