light-baseimage:0.2.1

This commit is contained in:
ofreax 2016-01-17 12:12:04 +01:00
parent 351dd6e113
commit 030d80b0a4
7 changed files with 30 additions and 27 deletions

View File

@ -1,7 +1,7 @@
# Changelog # Changelog
## 0.2.0 ## 0.2.0
- Upgrade baseimage: light-baseimage:0.2.0 - Upgrade baseimage: light-baseimage:0.2.1
- Makefile with build no cache - Makefile with build no cache
## 0.1.9 ## 0.1.9

View File

@ -1,23 +1,21 @@
FROM osixia/light-baseimage:0.2.0 # Use osixia/light-baseimage
# sources: https://github.com/osixia/docker-light-baseimage
FROM osixia/light-baseimage:0.2.1
MAINTAINER Bertrand Gouny <bertrand.gouny@osixia.net> 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's init system. # Download, build and install Keepalived
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/run
CMD ["/container/tool/run"]
# Install Keepalived
RUN apt-get -y update \ RUN apt-get -y update \
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ && LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl \ curl \
make \
gcc \ gcc \
pkg-config \
libssl-dev \
libnl-3-dev \ libnl-3-dev \
libnl-genl-3-dev \ libnl-genl-3-dev \
libssl-dev \
make \
pkg-config \
&& 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 /container/keepalived-sources \ && mkdir -p /container/keepalived-sources \
&& tar -xzf keepalived.tar.gz --strip 1 -C /container/keepalived-sources \ && tar -xzf keepalived.tar.gz --strip 1 -C /container/keepalived-sources \
@ -39,4 +37,4 @@ RUN /container/tool/install-service \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Add default env variables # Add default env variables
ADD env.yaml /container/environment/env.yaml ADD environment /container/environment/99-default

View File

@ -1,2 +0,0 @@
#!/bin/bash -e
exec /usr/local/sbin/keepalived -f /etc/keepalived/keepalived.conf --dont-fork --log-console -D -d

View File

@ -0,0 +1,7 @@
#!/bin/bash -e
# set -x (bash debug) if log level is trace
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/log-helper
log-helper level eq trace && set -x
exec /usr/local/sbin/keepalived -f /etc/keepalived/keepalived.conf --dont-fork --log-console -D -d

View File

@ -1,11 +1,15 @@
#!/bin/bash -e #!/bin/bash -e
FIRST_START_DONE="/etc/docker-keepalived-first-start-done" # set -x (bash debug) if log level is trace
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/log-helper
log-helper level eq trace && set -x
FIRST_START_DONE="${CONTAINER_STATE_DIR}/docker-keepalived-first-start-done"
# container first start # container first start
if [ ! -e "$FIRST_START_DONE" ]; then if [ ! -e "$FIRST_START_DONE" ]; then
ln -s /container/service/keepalived/assets/keepalived.conf /etc/keepalived/keepalived.conf ln -sf ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf /etc/keepalived/keepalived.conf
# #
# bootstrap config # bootstrap config

View File

@ -83,19 +83,17 @@ is_service_running_by_cid() {
} }
is_file_exists_by_cid() { is_file_exists_by_cid() {
docker exec $1 cat "/etc/my_init_startup_files_completed" > /dev/null 2>&1 docker exec $1 cat $2 > /dev/null 2>&1
} }
wait_service_by_cid() { wait_service_by_cid() {
cid=$1 cid=$1
sleep 1
# first wait image init end # first wait image init end
while ! is_file_exists_by_cid $cid /etc/my_init_startup_files_completed while ! is_file_exists_by_cid $cid /container/run/state/startup-done
do do
sleep 1 sleep 0.5
done done
for service in "${@:2}" for service in "${@:2}"
@ -103,9 +101,7 @@ wait_service_by_cid() {
# wait service # wait service
while ! is_service_running_by_cid $cid $service while ! is_service_running_by_cid $cid $service
do do
sleep 1 sleep 0.5
done done
done done
sleep 5
} }