环境说明:根据前文docker (七)部署zabbix进行zabbix告警配置时,发现zabbix没有脚本所需要的python3环境,也没有yum环境
参考 https://www.cnblogs.com/daniel-ming/p/15341636.html
Zabbix docker镜像 build Python3_docker zabbixserver python-CSDN博客
[root@dokcer-130 images]# cat dockerfile
FROM zabbix/zabbix-server-mysql:5.0-centosUSER root
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && \yum makecache && \yum install -y python3 && \pip3 install requests
docker build -t zabbix-server-mysql-py:5.0-centos /home/images/
容器起不来...查看日志
7:20240220:105203.749 ******************************
7:20240220:105203.749 using configuration file: /etc/zabbix/zabbix_server.conf
7:20240220:105203.785 The server does not match Zabbix database. Current database version (mandatory/optional): 06040000/06040026. Required mandatory version: 05000000.
原因:Zabbix 服务器与它连接的数据库之间存在版本不匹配
----明日再解决
这里有一篇文章介绍,里面有安装python3环境教程,亲测可用
docker安装zabbix的教程-CSDN博客