Linux运维笔记--------------------------------------------------- Docker zabbix-server-mysql build Python3 (告警功能)

官网下载Git 

git clone https://git.zabbix.com/scm/zbx/zabbix.git

因为alpine 镜像比较小,所以选择它。

Dockerfile

FROM zabbix/zabbix-server-mysql:alpine-6.4-latest
USER root
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add --update --no-cache curl python3 py3-pip
RUN pip install requests
USER zabbix

 

打包命令

docker build -t zabbix/zabbix-server-mysql-python3:alpine-6.4-latest  .   #创建新镜像ID
docker image save zabbix/zabbix-server-mysql-python3:alpine-6.4-latest zabbix-server.tar  # 导出 新镜像ID
docker image rm -f zabbix/zabbix-server-mysql-python3:alpine-6.4-latest  zabbix/zabbix-server-mysql:alpine-6.4-latest #删除原有镜像ID
docker image load -i  zabbix-server.tar   # 导入新镜像Id  覆盖原镜像ID
docker tag 镜像ID zabbix/zabbix-server-mysql:alpine-6.4-latest

 

启动zabbix服务器

docker-compose -f docker-compose_v3_alpine_mysql_latest.yaml up -d

  

posted @ 2023-11-03 16:09  lyh3420  阅读(61)  评论(0)    收藏  举报