forked from IQSS/dataverse
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat,fix(ct-base): add extension point for background script IQSS#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!
- Loading branch information
1 parent
8f39ef2
commit be82c36
Showing
2 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <<EOF | ||
|
@@ -214,9 +214,9 @@ RUN <<EOF | |
EOF | ||
|
||
# Set the entrypoint to tini (as a process supervisor) | ||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
# JSON syntax should be used, but bypassed shell. Thus re-add expansion via shell exec. | ||
CMD ["sh", "-c", "${SCRIPT_DIR}/entrypoint.sh"] | ||
ENTRYPOINT ["/usr/bin/dumb-init", "--"] | ||
# This works because we add ${SCRIPT_DIR} to $PATH above! | ||
CMD ["entrypoint.sh"] | ||
|
||
LABEL org.opencontainers.image.created="@git.build.time@" \ | ||
org.opencontainers.image.authors="Research Data Management at FZJ <[email protected]>" \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters