From de2ee28404b66efeb3deb53f227358579c165f2c Mon Sep 17 00:00:00 2001 From: Scott Little Date: Wed, 19 Jun 2019 16:24:57 -0400 Subject: [PATCH] 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 --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index a4007a5d..a2687a12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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. 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 CMD /usr/sbin/init