new baseimage
This commit is contained in:
parent
e107ae776f
commit
befaefc9e4
|
@ -4,30 +4,39 @@ MAINTAINER Bertrand Gouny <bertrand.gouny@osixia.net>
|
||||||
# Keepalived version
|
# Keepalived version
|
||||||
ENV KEEPALIVED_VERSION 1.2.19
|
ENV KEEPALIVED_VERSION 1.2.19
|
||||||
|
|
||||||
# Use baseimage-docker's init system.
|
# Use baseimage's init system.
|
||||||
CMD ["/osixia/tool/run"]
|
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/run
|
||||||
|
CMD ["/container/tool/run"]
|
||||||
|
|
||||||
# Install Keepalived
|
# Install Keepalived
|
||||||
RUN apt-get -y update \
|
RUN apt-get -y update \
|
||||||
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
curl make gcc pkg-config libssl-dev libnl-3-dev libnl-genl-3-dev \
|
curl \
|
||||||
|
make \
|
||||||
|
gcc \
|
||||||
|
pkg-config \
|
||||||
|
libssl-dev \
|
||||||
|
libnl-3-dev \
|
||||||
|
libnl-genl-3-dev \
|
||||||
&& curl -o keepalived.tar.gz -SL http://keepalived.org/software/keepalived-${KEEPALIVED_VERSION}.tar.gz \
|
&& curl -o keepalived.tar.gz -SL http://keepalived.org/software/keepalived-${KEEPALIVED_VERSION}.tar.gz \
|
||||||
&& mkdir -p /osixia/keepalived-sources \
|
&& mkdir -p /container/keepalived-sources \
|
||||||
&& tar -xzf keepalived.tar.gz --strip 1 -C /osixia/keepalived-sources \
|
&& tar -xzf keepalived.tar.gz --strip 1 -C /container/keepalived-sources \
|
||||||
&& cd osixia/keepalived-sources \
|
&& cd container/keepalived-sources \
|
||||||
&& ./configure --with-kernel-dir=/lib/modules/$(uname -r)/build \
|
&& ./configure --with-kernel-dir=/lib/modules/$(uname -r)/build \
|
||||||
&& make && make install \
|
&& make && make install \
|
||||||
&& cd - && mkdir -p /etc/keepalived \
|
&& cd - && mkdir -p /etc/keepalived \
|
||||||
&& apt-get remove -y --purge --auto-remove curl make gcc pkg-config libssl-dev
|
&& apt-get remove -y --purge --auto-remove curl make gcc pkg-config libssl-dev
|
||||||
|
|
||||||
# Add service directory to /osixia/service
|
# Add service directory to /container/service
|
||||||
ADD service /osixia/service
|
ADD service /container/service
|
||||||
|
|
||||||
# Clean all
|
|
||||||
# Use baseimage install-service script and clean all
|
# Use baseimage install-service script and clean all
|
||||||
RUN ./sbin/install-service \
|
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service
|
||||||
&& rm -f keepalived.tar.gz && rm -rf /osixia/keepalived-sources \
|
RUN /container/tool/install-service \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -f keepalived.tar.gz \
|
||||||
|
&& rm -rf /container/keepalived-sources \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
# Add default env variables
|
# Add default env variables
|
||||||
ADD env.yaml /etc/env.yaml
|
ADD env.yaml /etc/env.yaml
|
||||||
|
|
|
@ -13,4 +13,4 @@ KEEPALIVED_VIRTUAL_IPS:
|
||||||
- 192.168.1.231
|
- 192.168.1.231
|
||||||
- 192.168.1.232
|
- 192.168.1.232
|
||||||
|
|
||||||
KEEPALIVED_NOTIFY: /osixia/service/keepalived/assets/notify.sh
|
KEEPALIVED_NOTIFY: /container/service/keepalived/assets/notify.sh
|
||||||
|
|
|
@ -8,12 +8,12 @@ if [ ! -e "$FIRST_START_DONE" ]; then
|
||||||
# config folder is empty use bootstrap config if available
|
# config folder is empty use bootstrap config if available
|
||||||
if [ ! -e /etc/keepalived/keepalived.conf ]; then
|
if [ ! -e /etc/keepalived/keepalived.conf ]; then
|
||||||
echo "No keepalived.conf provided using image default one"
|
echo "No keepalived.conf provided using image default one"
|
||||||
if [ ! -e /osixia/service/keepalived/assets/keepalived.conf ]; then
|
if [ ! -e /container/service/keepalived/assets/keepalived.conf ]; then
|
||||||
echo "Error: No default keepalived.conf found in /osixia/service/keepalived/assets/keepalived.conf"
|
echo "Error: No default keepalived.conf found in /container/service/keepalived/assets/keepalived.conf"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
|
||||||
ln -s /osixia/service/keepalived/assets/keepalived.conf /etc/keepalived/keepalived.conf
|
ln -s /container/service/keepalived/assets/keepalived.conf /etc/keepalived/keepalived.conf
|
||||||
|
|
||||||
#
|
#
|
||||||
# bootstrap config
|
# bootstrap config
|
||||||
|
|
Loading…
Reference in New Issue