From 02f379ce6b690dd0d0ef80373b9d83a0c33216af Mon Sep 17 00:00:00 2001 From: fanux Date: Tue, 20 Nov 2018 21:17:03 +0800 Subject: [PATCH] using supervisor to start keepalived --- Dockerfile-keepalived | 14 ++++++++------ super-keep.conf | 9 +++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 super-keep.conf diff --git a/Dockerfile-keepalived b/Dockerfile-keepalived index a202a133c4f..c3e17930275 100644 --- a/Dockerfile-keepalived +++ b/Dockerfile-keepalived @@ -1,8 +1,10 @@ FROM centos:7.4.1708 -RUN yum install -y wget && yum install -y gcc-c++ openssl-devel openssl && yum install -y net-tools -RUN wget -O /usr/local/bin/dumb-init \ - https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 \ - && chmod +x /usr/local/bin/dumb-init +RUN yum install -y wget && yum install -y gcc-c++ openssl-devel openssl && yum install -y net-tools && yum install -y python-setuptools && easy_install supervisor +# RUN wget -O /usr/local/bin/dumb-init \ +# https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 \ +# && chmod +x /usr/local/bin/dumb-init RUN wget http://www.keepalived.org/software/keepalived-2.0.8.tar.gz && tar zxvf keepalived-2.0.8.tar.gz && cd keepalived-2.0.8 && ./configure && make && make install -ENTRYPOINT ["/usr/bin/dumb-init", "--"] -CMD ["keepalived", "--all", "-d", "-D", "-f", "/etc/keepalived/keepalived.conf", "--log-console"] +# ENTRYPOINT ["/usr/local/bin/dumb-init", "--"] +# CMD ["keepalived", "--all", "-d", "-D", "-f", "/etc/keepalived/keepalived.conf", "--log-console"] +COPY super-keep.conf . +CMD ["supervisord", "-c", "super-keep.conf"] diff --git a/super-keep.conf b/super-keep.conf new file mode 100644 index 00000000000..feccf9ce1e8 --- /dev/null +++ b/super-keep.conf @@ -0,0 +1,9 @@ +[program:keepalived] +command=keepalived --all -d -D -f /etc/keepalived/keepalived.conf --log-console +autostart=true +autorestart=false +startsecs=1 +redirect_stderr = true + +[supervisord] +nodaemon = true