diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 22a6278f4c..49700bc4b3 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -262,6 +262,8 @@ RUN touch /usr/local/bin/kolla_extend_start \ && chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs \ && chmod 440 /etc/sudoers \ && groupadd kolla \ - && rm -f /tmp/kolla_bashrc + && rm -f /tmp/kolla_bashrc \ + && 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 CMD ["kolla_start"] diff --git a/docker/base/start.sh b/docker/base/start.sh index b45660bd8f..c1dfe68cc4 100644 --- a/docker/base/start.sh +++ b/docker/base/start.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/local/bin/dumb-init /bin/bash set -o errexit # Wait for the log socket diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2 index 44611c059a..8e12bfce9a 100644 --- a/docker/kolla-toolbox/Dockerfile.j2 +++ b/docker/kolla-toolbox/Dockerfile.j2 @@ -66,7 +66,7 @@ COPY ansible.cfg /home/ansible/.ansible.cfg COPY ansible_sudoers /etc/sudoers.d/ansible_sudoers RUN chmod 440 /etc/sudoers.d/ansible_sudoers -CMD ["/bin/sleep", "infinity"] +CMD ["/usr/local/bin/dumb-init", "/bin/sleep", "infinity"] {% block kolla_toolbox_footer %}{% endblock %} {% block footer %}{% endblock %} diff --git a/releasenotes/notes/add-dumb-init-manage-root-process-e25a529b322d4fac.yaml b/releasenotes/notes/add-dumb-init-manage-root-process-e25a529b322d4fac.yaml new file mode 100644 index 0000000000..cc8854fd8b --- /dev/null +++ b/releasenotes/notes/add-dumb-init-manage-root-process-e25a529b322d4fac.yaml @@ -0,0 +1,3 @@ +--- +features: + - use dumb-init to manage the pid 1 process