forked from ultimate010/haproxy-keepalived-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (25 loc) · 1.12 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
FROM haproxy:1.7.9
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y gettext
# install keepalived
RUN mkdir -p /data/keepalived && cd /data && apt-get install -y wget \
&& wget http://www.keepalived.org/software/keepalived-1.3.9.tar.gz && tar xf keepalived-1.3.9.tar.gz -C keepalived --strip-components 1 \
&& cd keepalived && apt-get install -y gcc && apt-get install -y libssl-dev && apt-get -y install libpopt-dev \
&& ./configure && apt-get install -y make && make && make install
RUN apt-get install -y net-tools
# entrypoint
COPY docker-entrypoint-override.sh /
RUN chmod +x /docker-entrypoint-override.sh
# haproxy
COPY haproxy/init_haproxy_conf.sh /haproxy/
COPY haproxy/haproxy_template.conf /haproxy/
RUN chmod +x /haproxy/init_haproxy_conf.sh
# keepalived
COPY keepalived/keepalived_template.conf /keepalived/
COPY keepalived/init_keepalived_conf.sh /keepalived/
COPY keepalived/start_keepalived.sh /
RUN chmod +x /keepalived/init_keepalived_conf.sh
# Override haproxy's entrypoint
ENTRYPOINT ["/docker-entrypoint-override.sh"]
# CMD
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]