From f9e634ca6b5e6aa33369858e73433409fe10dd2f Mon Sep 17 00:00:00 2001 From: Martin André Date: Fri, 7 Apr 2017 11:35:16 +0200 Subject: Move shebang customization into jinja2 block By setting up the shebang inside a jinja2 block, this allows the operator to use a different init system of simply disable it. This is especially useful with docker 1.13 that comes with its own stripped down init system (a build of tini) that would cause the containers to run double init systems if used with the '--init' command line argument. Change-Id: I220d8cfc81c25471e635b2f5790759f21e788e64 Closes-Bug: #1680770 --- docker/base/Dockerfile.j2 | 6 ++++-- docker/base/start.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'docker') diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 30a3150f0..2e575df82 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -366,7 +366,8 @@ COPY curlrc /root/.curlrc {% if base_arch == 'x86_64' %} RUN curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 -o /usr/local/bin/dumb-init \ - && chmod +x /usr/local/bin/dumb-init + && chmod +x /usr/local/bin/dumb-init \ + && sed -i 's|#!|#!/usr/local/bin/dumb-init |' /usr/local/bin/kolla_start {% else %} @@ -376,7 +377,8 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ && python get-pip.py \ && rm get-pip.py \ && pip --no-cache-dir install --prefix='/usr/local' dumb-init==1.1.3 \ - && chmod +x /usr/local/bin/dumb-init + && chmod +x /usr/local/bin/dumb-init \ + && sed -i 's|#!|#!/usr/local/bin/dumb-init |' /usr/local/bin/kolla_start {% endif %} {% endblock %} diff --git a/docker/base/start.sh b/docker/base/start.sh index 3ca6291fc..261291268 100644 --- a/docker/base/start.sh +++ b/docker/base/start.sh @@ -1,4 +1,4 @@ -#!/usr/local/bin/dumb-init /bin/bash +#!/bin/bash set -o errexit # Wait for the log socket -- cgit v1.2.3