From 358f1a2521849c8a7589363ac45a7dc0d6719aff Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 14 Sep 2022 21:18:28 +0200 Subject: [PATCH] feat,fix(ct-base): add extension point for background script #8932 By moving from tini to dumb-init, we can offer a new extension point: if an application image extending this base image provides an executable script at ${SCRIPT_DIR}/startInBackground.sh, it will be executed after the init scripts and in parallel to the application server. By adding ${SCRIPT_DIR} to $PATH, we can now also skip variable expansion, fixing a bug: formerly, the "exec" in entrypoint.sh and startInForeground.sh where not replacing the shell properly. The switch to dumb-init makes sure signals will be transferred also to any background processes! --- .../container-base/src/main/docker/Dockerfile | 10 +++++----- .../src/main/docker/scripts/entrypoint.sh | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/modules/container-base/src/main/docker/Dockerfile b/modules/container-base/src/main/docker/Dockerfile index 68b9da13c67..c56abb975e2 100644 --- a/modules/container-base/src/main/docker/Dockerfile +++ b/modules/container-base/src/main/docker/Dockerfile @@ -46,7 +46,7 @@ ENV PAYARA_DIR="${HOME_DIR}/appserver" \ ADMIN_PASSWORD="admin" \ DOMAIN_NAME="domain1" \ PAYARA_ARGS="" -ENV PATH="${PATH}:${PAYARA_DIR}/bin" \ +ENV PATH="${PATH}:${PAYARA_DIR}/bin:${SCRIPT_DIR}" \ DOMAIN_DIR="${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}" \ DEPLOY_PROPS="" \ PREBOOT_COMMANDS="${CONFIG_DIR}/pre-boot-commands.asadmin" \ @@ -88,7 +88,7 @@ EOF ARG JATTACH_VERSION="v2.1" ARG JATTACH_CHECKSUM="07885fdc782e02e7302c6d190f54c3930afa10a38140365adf54076ec1086a8e" -ARG PKGS="jq imagemagick curl unzip wget acl dirmngr gpg lsof procps netcat tini" +ARG PKGS="jq imagemagick curl unzip wget acl dirmngr gpg lsof procps netcat dumb-init" # Installing the packages in an extra container layer for better caching RUN <