Docker build environment does not exit cleanly.

Our docker builder runs services under systemd.
Systemd requires SIGRTMIN+3 to trigger a clean exit.
The 'docker stop' command will send SIGTERM by default,
which systemd ignores.

Failure to exit cleanly results in mounts being left in
place, and ultimately the container will get stuck in
'Removal in progress' state, and a docker image that
can't be removed.

Change-Id: I28edb021a4f9c8941a7be57bfbb2ffa34b15ccd7
Closes-Bug: 1833467
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2019-06-19 16:24:57 -04:00
parent 67e2d3e4c0
commit de2ee28404

View File

@ -243,5 +243,9 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
# Try to continue a yum command even if a StarlingX repo is unavailable. # Try to continue a yum command even if a StarlingX repo is unavailable.
RUN yum-config-manager --setopt=StarlingX\*.skip_if_unavailable=1 --save RUN yum-config-manager --setopt=StarlingX\*.skip_if_unavailable=1 --save
# When we run 'init' below, it will run systemd, and systemd requires RTMIN+3
# to exit cleanly. By default, docker stop uses SIGTERM, which systemd ignores.
STOPSIGNAL RTMIN+3
# Don't know if it's possible to run services without starting this # Don't know if it's possible to run services without starting this
CMD /usr/sbin/init CMD /usr/sbin/init