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
This commit is contained in:
Martin André 2017-04-07 11:35:16 +02:00
parent 2e43891838
commit f9e634ca6b
3 changed files with 13 additions and 3 deletions

View File

@ -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 %}

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dumb-init /bin/bash
#!/bin/bash
set -o errexit
# Wait for the log socket

View File

@ -0,0 +1,8 @@
---
features:
- Make containers init system configurable. This is particularly useful with
docker 1.13 that comes with its own minimal init and would result in double
init system with used with the `--init` command line argument.
upgrade:
- The operator now needs to customize the shebang as part of the minimal init
install.