docker run --name mysql-server -t \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix" \ -e MYSQL_ROOT_PASSWORD="zabbix" \ -d mysql:5.7 \ --character-set-server=utf8 --collation-server=utf8_bin
docker run --name zabbix-server-mysql -t \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix" \ -e MYSQL_ROOT_PASSWORD="zabbix" \ --link mysql-server:mysql \ -p 10051:10051 \ -d zabbix/zabbix-server-mysql:latest
docker run --name zabbix-web-nginx-mysql -t \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix" \ -e MYSQL_ROOT_PASSWORD="zabbix" \ --link mysql-server:mysql \ --link zabbix-server-mysql:zabbix-server \ -p 8080:80 \ -d zabbix/zabbix-web-nginx-mysql:latest
[root@zabbix_server ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
98cbe8d8a6bd zabbix/zabbix-web-nginx-mysql:latest "docker-entrypoint.sh" 6 seconds ago Up 5 seconds 443/tcp, 0.0.0.0:8080->80/tcp zabbix-web-nginx-mysql
de040d43d60f zabbix/zabbix-server-mysql:latest "docker-entrypoint.sh" 59 seconds ago Up 59 seconds 0.0.0.0:10051->10051/tcp zabbix-server-mysql
3276f18def8d mysql:5.7 "docker-entrypoint.s…" About a minute ago Up About a minute 3306/tcp mysql-server
[root@zabbix_server ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
zabbix/zabbix-web-nginx-mysql latest 4db891b4393a 10 hours ago 177MB
zabbix/zabbix-server-mysql latest f5e58dafe9ac 10 hours ago 62.2MB
mysql 5.7 f0f3956a9dd8 7 days ago 409MB