一、创建docker-compose.yml文件

  1. version: '2'
  2. services:
  3. zabbix-mysql:
  4. image: daocloud.io/library/mysql:8
  5. container_name: zabbix-mysql
  6. environment:
  7. - MYSQL_ROOT_PASSWORD=123456
  8. restart: always
  9. zabbix-server:
  10. image: monitoringartist/zabbix-xxl
  11. links:
  12. - zabbix-mysql:mysqlhost
  13. container_name: zabbix-server
  14. restart: always
  15. depends_on:
  16. - zabbix-mysql
  17. ports:
  18. - "8888:80"
  19. environment:
  20. - ZS_DBHost=mysqlhost
  21. - ZS_DBUser=root
  22. - ZS_DBPassword=123456

二、运行

  1. docker-compose up -d