Last active
July 17, 2017 07:38
-
-
Save mattintosh4/6c7b79b48c11eec3181fc252dd5afb5a to your computer and use it in GitHub Desktop.
CentOS 7 & Zabbix 3.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM centos:centos7 | |
| MAINTAINER m-yoshida | |
| ## Initialization | |
| RUN localedef -i ja_JP -f UTF-8 /usr/lib/locale/ja_JP.UTF-8 \ | |
| && sed -i'' '/^mirrorlist/{s|^|#|};/^#baseurl/{s|^#||;s|mirror.centos.org|ftp.riken.jp/Linux|}' /etc/yum.repos.d/CentOS-Base.repo \ | |
| && sed -i'' '/^enable/{s|1|0|}' /etc/yum/pluginconf.d/*.conf \ | |
| && rpm --import http://ftp.riken.jp/Linux/centos/RPM-GPG-KEY-CentOS-7 \ | |
| && yum clean all \ | |
| && yum update -y | |
| ## Zabbix installation | |
| RUN rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm \ | |
| && yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese mariadb-server zabbix-agent \ | |
| && yumdownloader zabbix-server-mysql && rpm -ivh --replacepkgs zabbix-server-mysql-3.0.*.rpm && rm -f zabbix-server-mysql-3.0.*.rpm \ | |
| && yum clean all \ | |
| && sed -i'' '/php_value date.timezone/{s|# ||;s|Europe/Riga|Asia/Tokyo|;}' /etc/httpd/conf.d/zabbix.conf | |
| ## MySQL Settings | |
| # Disable database password | |
| RUN /usr/libexec/mariadb-prepare-db-dir \ | |
| && /bin/sh -c "/usr/bin/mysqld_safe & sleep 5" \ | |
| && echo "create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost;" | mysql -uroot \ | |
| && zcat /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz | mysql -uzabbix zabbix | |
| # Enable database password | |
| #RUN /usr/libexec/mariadb-prepare-db-dir \ | |
| #RUN /bin/sh -c "/usr/bin/mysqld_safe & sleep 5" \ | |
| #&& echo "create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';" | mysql -uroot \ | |
| #&& zcat /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz | mysql -uzabbix -pzabbix zabbix | |
| #RUN echo "DBPassword=zabbix" >>/etc/zabbix/zabbix_server.conf | |
| EXPOSE 80 | |
| EXPOSE 10050 10051 | |
| CMD /usr/sbin/zabbix_server \ | |
| && /usr/sbin/zabbix_agentd \ | |
| && /bin/sh -c '/usr/bin/mysqld_safe & sleep 1' \ | |
| && /usr/sbin/httpd -DFOREGROUND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://localhost/zabbix