forked from dkanbier/docker-zabbix-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 870 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM centos:centos6
MAINTAINER Dennis Kanbier <[email protected]>
# Update base images.
RUN yum distribution-synchronization -y
RUN yum makecache
# Install MySQL software
RUN yum -y -q install mysql mysql-server
# Cleanup
RUN yum clean all
# MySQL Config
ADD ./mysql/my.cnf /etc/mysql/conf.d/my.cnf
ADD ./zabbix/create/data.sql /tmp/create/data.sql
ADD ./zabbix/create/images.sql /tmp/create/images.sql
ADD ./zabbix/create/schema.sql /tmp/create/schema.sql
# https://github.com/dotcloud/docker/issues/1240#issuecomment-21807183
RUN echo "NETWORKING=yes" > /etc/sysconfig/network
# Custom script to setup Zabbix schema and start mysqld_safe
ADD ./scripts/start.sh /start.sh
RUN chmod 755 /start.sh
# Expose MySQL default port
EXPOSE 3306
# Use a volume for MySQL data
VOLUME ["/var/lib/mysql"]
# Sart the custom start script
CMD ["/bin/bash", "/start.sh"]