Merge "Add config option use_dumb_init to add it to container images"
This commit is contained in:
commit
32693b8338
|
@ -407,8 +407,9 @@ COPY start.sh /usr/local/bin/kolla_start
|
||||||
COPY sudoers /etc/sudoers
|
COPY sudoers /etc/sudoers
|
||||||
COPY curlrc /root/.curlrc
|
COPY curlrc /root/.curlrc
|
||||||
|
|
||||||
{% block dumb_init_installation %}
|
{% if use_dumb_init %}
|
||||||
|
|
||||||
|
{% block dumb_init_installation %}
|
||||||
{% if base_arch == 'x86_64' %}
|
{% if base_arch == 'x86_64' %}
|
||||||
|
|
||||||
RUN curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_{{debian_arch}} -o /usr/local/bin/dumb-init \
|
RUN curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_{{debian_arch}} -o /usr/local/bin/dumb-init \
|
||||||
|
@ -428,10 +429,11 @@ RUN curl -sSL http://deb.debian.org/debian/pool/main/d/dumb-init/{{dumb_init_pac
|
||||||
&& rm data.tar.xz {{dumb_init_package_name}}
|
&& rm data.tar.xz {{dumb_init_package_name}}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
ENTRYPOINT ["dumb-init", "--single-child", "--"]
|
ENTRYPOINT ["dumb-init", "--single-child", "--"]
|
||||||
|
|
||||||
{% endblock %}
|
{% endif %}
|
||||||
|
|
||||||
RUN touch /usr/local/bin/kolla_extend_start \
|
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 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs \
|
||||||
|
|
|
@ -52,15 +52,18 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start \
|
||||||
RUN mkdir -p /var/run/mysqld && chown mysql /var/run/mysqld && chmod 755 /var/run/mysqld
|
RUN mkdir -p /var/run/mysqld && chown mysql /var/run/mysqld && chmod 755 /var/run/mysqld
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if use_dumb_init %}
|
||||||
{% block mariadb_entrypoint %}
|
{% block mariadb_entrypoint %}
|
||||||
# NOTE(mgoddard): Override the dumb-init arguments to avoid passing
|
# NOTE(mgoddard): Override the dumb-init arguments to avoid passing
|
||||||
# --single-child. This does not play well with mysqld_safe, which ignores
|
# --single-child. This does not play well with mysqld_safe, which ignores
|
||||||
# SIGTERM, meaning Docker needs to forcibly kill the container to stop it.
|
# SIGTERM, meaning Docker needs to forcibly kill the container to stop it.
|
||||||
# Without --single-child, the TERM signal is sent to all subprocesses,
|
# Without --single-child, the TERM signal is sent to all subprocesses,
|
||||||
# including mysqld.
|
# including mysqld.
|
||||||
ENTRYPOINT ["dumb-init"]
|
|
||||||
|
ENTRYPOINT ["dumb-init", "--"]
|
||||||
CMD ["kolla_start"]
|
CMD ["kolla_start"]
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block mariadb_footer %}{% endblock %}
|
{% block mariadb_footer %}{% endblock %}
|
||||||
{% block footer %}{% endblock %}
|
{% block footer %}{% endblock %}
|
||||||
|
|
|
@ -184,6 +184,8 @@ _CLI_OPTS = [
|
||||||
cfg.StrOpt('base-arch', default=hostarch,
|
cfg.StrOpt('base-arch', default=hostarch,
|
||||||
choices=BASE_ARCH,
|
choices=BASE_ARCH,
|
||||||
help='The base architecture. Default is same as host.'),
|
help='The base architecture. Default is same as host.'),
|
||||||
|
cfg.BoolOpt('use-dumb-init', default=True,
|
||||||
|
help='Use dumb-init as init system in containers'),
|
||||||
cfg.BoolOpt('debug', short='d', default=False,
|
cfg.BoolOpt('debug', short='d', default=False,
|
||||||
help='Turn on debugging log level'),
|
help='Turn on debugging log level'),
|
||||||
cfg.BoolOpt('skip-parents', default=False,
|
cfg.BoolOpt('skip-parents', default=False,
|
||||||
|
|
|
@ -681,6 +681,7 @@ class KollaWorker(object):
|
||||||
else:
|
else:
|
||||||
self.namespace = conf.namespace
|
self.namespace = conf.namespace
|
||||||
self.base = conf.base
|
self.base = conf.base
|
||||||
|
self.use_dumb_init = conf.use_dumb_init
|
||||||
self.base_tag = conf.base_tag
|
self.base_tag = conf.base_tag
|
||||||
self.install_type = conf.install_type
|
self.install_type = conf.install_type
|
||||||
self.tag = conf.tag
|
self.tag = conf.tag
|
||||||
|
@ -926,6 +927,7 @@ class KollaWorker(object):
|
||||||
'base_image': self.conf.base_image,
|
'base_image': self.conf.base_image,
|
||||||
'base_distro_tag': self.base_tag,
|
'base_distro_tag': self.base_tag,
|
||||||
'base_arch': self.base_arch,
|
'base_arch': self.base_arch,
|
||||||
|
'use_dumb_init': self.use_dumb_init,
|
||||||
'base_package_type': self.base_package_type,
|
'base_package_type': self.base_package_type,
|
||||||
'debian_arch': self.debian_arch,
|
'debian_arch': self.debian_arch,
|
||||||
'supported_distro_release': supported_distro_release,
|
'supported_distro_release': supported_distro_release,
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Adds configration option ``use_dumb_init``, with default value of ``True``.
|
||||||
|
This can be use to avoid the of ``dumb-init`` as the container entrypoint,
|
||||||
|
using ``kolla_start`` directly instead. This option can also be disabled
|
||||||
|
via the ``kolla-build --nouse-dumb-init`` CLI argument.
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Moves the ``ENTRYPOINT`` statement outside of the
|
||||||
|
``dumb_init_installation`` Jinja block in the base image. Overriding this
|
||||||
|
block to install ``dumb-init`` by another method no longer requires
|
||||||
|
repeating the ``ENTRYPOINT`` statement. Users wishing to avoid the use of
|
||||||
|
``dumb-init`` altogether can now use the ``use_dumb_init`` configuration
|
||||||
|
option.
|
Loading…
Reference in New Issue