环境说明:根据前文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-centos
USER 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博客文章来源:https://www.toymoban.com/news/detail-835260.html
文章来源地址https://www.toymoban.com/news/detail-835260.html
到了这里,关于docker (九)-进阶篇-dockerfile制作zabbix镜像(带python3环境)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!