-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
42 lines (31 loc) · 1.37 KB
/
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
35
36
37
38
39
40
41
42
FROM centos:7
MAINTAINER Andrea Sosso <[email protected]>
ENV MAXSCALE_VERSION 2.2.5
ENV MAXSCALE_URL https://downloads.mariadb.com/MaxScale/${MAXSCALE_VERSION}/rhel/7/x86_64/maxscale-${MAXSCALE_VERSION}-1.rhel.7.x86_64.rpm
RUN curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --skip-server --skip-tools \
&& yum -y update \
&& yum deplist maxscale | grep provider | awk '{print $2}' | sort | uniq | grep -v maxscale | sed ':a;N;$!ba;s/\n/ /g' | xargs yum -y install \
&& rpm -Uvh ${MAXSCALE_URL} \
&& yum clean all \
&& rm -rf /tmp/*
# Move configuration file in directory for exports and enable maxadmin cli
RUN mkdir -p /etc/maxscale.d \
&& cp /etc/maxscale.cnf.template /etc/maxscale.d/maxscale.cnf \
&& ln -sf /etc/maxscale.d/maxscale.cnf /etc/maxscale.cnf \
&& chown root:maxscale /etc/maxscale.d/maxscale.cnf \
&& chmod g+w /etc/maxscale.d/maxscale.cnf \
&& echo '[{"name": "root", "account": "admin", "password": ""}, {"name": "maxscale", "account": "admin", "password": ""}]' > /var/lib/maxscale/maxadmin-users
# VOLUME for custom configuration
VOLUME ["/etc/maxscale.d"]
USER maxscale
# EXPOSE the MaxScale default ports
## RW Split Listener
EXPOSE 4006
## Read Connection Listener
EXPOSE 4008
## Debug Listener
EXPOSE 4442
## CLI Listener
EXPOSE 6603
# Running MaxScale
ENTRYPOINT ["/usr/bin/maxscale", "-d"]