From 293ead4f356bc14b3e4ad6ff40c3a0efb79becb8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 10 Aug 2022 21:31:57 -0400 Subject: [PATCH] feat: force-disable the --init flag for linuxserver images All linuxserver images uses S6, and there are enough of them that this makes sense to autodetect on behalf of users. --- docs/deployment/schedulers/docker-local.md | 2 ++ .../scheduler-docker-local/bin/scheduler-deploy-process | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/docs/deployment/schedulers/docker-local.md b/docs/deployment/schedulers/docker-local.md index da9039a79..b4f9359d4 100644 --- a/docs/deployment/schedulers/docker-local.md +++ b/docs/deployment/schedulers/docker-local.md @@ -51,6 +51,8 @@ Once set, you may re-enable it by setting a blank value for `init-process`: dokku scheduler-docker-local:set node-js-app init-process ``` +All image containers with the label `org.opencontainers.image.vendor=linuxserver.io` will have the automatic init process injection force-disabled without further intervention. + ### Deploying Process Types in Parallel > New as of 0.25.5 diff --git a/plugins/scheduler-docker-local/bin/scheduler-deploy-process b/plugins/scheduler-docker-local/bin/scheduler-deploy-process index 68b0eac5d..3d946b0e5 100755 --- a/plugins/scheduler-docker-local/bin/scheduler-deploy-process +++ b/plugins/scheduler-docker-local/bin/scheduler-deploy-process @@ -7,6 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions" main() { declare APP="$1" IMAGE_SOURCE_TYPE="$2" IMAGE="$3" IMAGE_TAG="$4" PROC_TYPE="$5" PROC_COUNT="$6" local CONTAINER_INDEX=1 + local image_vendor dokku_log_info1 "Deploying $PROC_TYPE (count=$PROC_COUNT)" DOKKU_CHECKS_DISABLED="$(is_app_proctype_checks_disabled "$APP" "$PROC_TYPE")" @@ -36,6 +37,12 @@ main() { done INJECT_INIT_FLAG="$(fn-plugin-property-get "scheduler-docker-local" "$APP" "init-process" "true")" + # special-case linuxserver.io images as those always use an s6-overlay + image_vendor="$("$DOCKER_BIN" image inspect --format '{{ index .Config.Labels "org.opencontainers.image.vendor" }}' "$IMAGE")" + if [[ "$image_vendor" == "linuxserver.io" ]]; then + INJECT_INIT_FLAG="false" + fi + PARALLEL_DEPLOY_COUNT="$(plugn trigger "app-json-process-deploy-parallelism" "$APP" "$PROC_TYPE")" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" parallel --will-cite --halt soon,fail=1 --jobs "$PARALLEL_DEPLOY_COUNT" --ungroup <"$PROCESS_TMP_FILE"