准备环境:

mysql8高版本中报错(因此使用5.6或5.7就可以了)

[2059] Plugin caching_sha2_password could not be loaded: Error loading shared library lib/mariadb/plugin/caching_sha2_password.so: No such file or directory

mysql-server

docker run --name mysql-server -t -e DB_SERVER_HOST=192.168.10.200  -e DB_SERVER_PORT=3307 -e MYSQL_DATABASE="zabbix"  -e MYSQL_USER="zabbix"  -e MYSQL_PASSWORD="Test1234."  -e MYSQL_ROOT_PASSWORD="Test1234."  -v /data/zabbix/mysql:/var/lib/mysql -d mysql:5.7

zabbix-server-mysql

docker run --name zabbix-server-mysql -t -e DB_SERVER_HOST="192.168.10.200" -e DB_SERVER_PORT=3307 -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="Test1234." -e MYSQL_ROOT_PASSWORD="Test1234." --link mysql-server:mysql -p 10051:10051 -d zabbix/zabbix-server-mysql:latest

zabbix-web-nginx-mysql

docker run --name zabbix-web-nginx-mysql -t -e DB_SERVER_HOST="192.168.10.200" -e DB_SERVER_PORT=3307 -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="Test1234." -e MYSQL_ROOT_PASSWORD="Test1234."  --link mysql-server:mysql --link zabbix-server-mysql:zabbix-server -p 8088:80 -d zabbix/zabbix-web-nginx-mysql:latest

若有问题查看日志: docker logs [NAMES]OR[CONTAINER ID]

正常启动后访问访问: http://192.168.10.200:8088/zabbix