From 97714e9c22954cf10b0f69910b9d15a0e6a31980 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 20:28:13 -0500 Subject: [PATCH 01/23] feat: filter out unsupported build arguments with pack While this will require future updates if pack supports new build arguments, it also ensures builds safely consume arguments from other plugins. --- plugins/builder-pack/builder-build | 123 ++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 3 deletions(-) diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 627662202..7eb612280 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -50,17 +50,134 @@ trigger-builder-pack-builder-build() { declare -a PACK_ARGS while true; do case "$1" in - --volume=* | -v=*) + -B | --builder) + PACK_ARGS+=("--builder") + PACK_ARGS+=("$2") + shift 2 + ;; + -b | --buildpack) + PACK_ARGS+=("--buildpack") + PACK_ARGS+=("$2") + shift 2 + ;; + -r | --buildpack-registry) + PACK_ARGS+=("--buildpack-registry") + PACK_ARGS+=("$2") + shift 2 + ;; + -D | --default-process) + PACK_ARGS+=("--default-process") + PACK_ARGS+=("$2") + shift 2 + ;; + -d | --descriptor) + PACK_ARGS+=("--descriptor") + PACK_ARGS+=("$2") + shift 2 + ;; + -e | --env) + PACK_ARGS+=("--env") + PACK_ARGS+=("$2") + shift 2 + ;; + -p | --path) + PACK_ARGS+=("--path") + PACK_ARGS+=("$2") + shift 2 + ;; + -t | --tag) + PACK_ARGS+=("--tag") + PACK_ARGS+=("$2") + shift 2 + ;; + --cache | --cache-image | --creation-time | --docker-host | --env-file | --extension | --gid | --insecure-registry | --lifecycle-image | --network | --platform | --post-buildpack | --pre-buildpack | --previous-image | --pull-policy | --report-output-dir | --run-image | --sbom-output-dir | --uid | --workspace) PACK_ARGS+=("$1") - shift + PACK_ARGS+=("$2") + shift 2 + ;; + --clear-cache | --disable-system-buildpacks | --publish | --trust-builder | --trust-extra-buildpacks | --userns-host) + PACK_ARGS+=("$1") + shift 1 ;; --volume | -v) PACK_ARGS+=("--volume") PACK_ARGS+=("$2") shift 2 ;; + -B=* | --builder=*) + if [[ "$1" == "--builder=*" ]]; then + PACK_ARGS+=("--builder" "${1#--builder=}") + elif [[ "$1" == "-B=*" ]]; then + PACK_ARGS+=("--builder" "${1#-B=}") + fi + shift 1 + ;; + -b=* | --buildpack=*) + if [[ "$1" == "--buildpack=*" ]]; then + PACK_ARGS+=("--buildpack" "${1#--buildpack=}") + elif [[ "$1" == "-b=*" ]]; then + PACK_ARGS+=("--buildpack" "${1#-b=}") + fi + shift 1 + ;; + -r=* | --buildpack-registry=*) + if [[ "$1" == "--buildpack-registry=*" ]]; then + PACK_ARGS+=("--buildpack-registry" "${1#--buildpack-registry=}") + elif [[ "$1" == "-r=*" ]]; then + PACK_ARGS+=("--buildpack-registry" "${1#-r=}") + fi + shift 2 + ;; + -D=* | --default-process=*) + if [[ "$1" == "--default-process=*" ]]; then + PACK_ARGS+=("--default-process" "${1#--default-process=}") + elif [[ "$1" == "-D=*" ]]; then + PACK_ARGS+=("--default-process" "${1#-D=}") + fi + shift 1 + ;; + -d=* | --descriptor=*) + if [[ "$1" == "--descriptor=*" ]]; then + PACK_ARGS+=("--descriptor" "${1#--descriptor=}") + elif [[ "$1" == "-d=*" ]]; then + PACK_ARGS+=("--descriptor" "${1#-d=}") + fi + shift 1 + ;; + -e=* | --env=*) + if [[ "$1" == "--env=*" ]]; then + PACK_ARGS+=("--env" "${1#--env=}") + elif [[ "$1" == "-e=*" ]]; then + PACK_ARGS+=("--env" "${1#-e=}") + fi + shift 1 + ;; + -p=* | --path=*) + if [[ "$1" == "--path=*" ]]; then + PACK_ARGS+=("--path" "${1#--path=}") + elif [[ "$1" == "-p=*" ]]; then + PACK_ARGS+=("--path" "${1#-p=}") + fi + shift 1 + ;; + -t=* | --tag=*) + if [[ "$1" == "--tag=*" ]]; then + PACK_ARGS+=("--tag" "${1#--tag=}") + elif [[ "$1" == "-t=*" ]]; then + PACK_ARGS+=("--tag" "${1#-t=}") + fi + shift 1 + ;; + --volume=* | -v=*) + if [[ "$1" == "--volume=*" ]]; then + PACK_ARGS+=("--volume" "${1#--volume=}") + elif [[ "$1" == "-v=*" ]]; then + PACK_ARGS+=("--volume" "${1#-v=}") + fi + shift 1 + ;; *) - break + continue ;; esac done From 8cb59892207aea90adeefd32eb14a725904b7012 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:27:26 -0500 Subject: [PATCH 02/23] fix: remove manually set arguments --- plugins/builder-pack/builder-build | 44 +----------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 7eb612280..7d303a143 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -38,23 +38,15 @@ trigger-builder-pack-builder-build() { plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") - [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true " DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") + [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true " DOCKER_ARGS=" $DOCKER_ARGS " - declare -a ARG_ARRAY - eval "ARG_ARRAY=($DOCKER_ARGS)" - eval set -- "$DOCKER_ARGS" declare -a PACK_ARGS while true; do case "$1" in - -B | --builder) - PACK_ARGS+=("--builder") - PACK_ARGS+=("$2") - shift 2 - ;; -b | --buildpack) PACK_ARGS+=("--buildpack") PACK_ARGS+=("$2") @@ -65,11 +57,6 @@ trigger-builder-pack-builder-build() { PACK_ARGS+=("$2") shift 2 ;; - -D | --default-process) - PACK_ARGS+=("--default-process") - PACK_ARGS+=("$2") - shift 2 - ;; -d | --descriptor) PACK_ARGS+=("--descriptor") PACK_ARGS+=("$2") @@ -80,11 +67,6 @@ trigger-builder-pack-builder-build() { PACK_ARGS+=("$2") shift 2 ;; - -p | --path) - PACK_ARGS+=("--path") - PACK_ARGS+=("$2") - shift 2 - ;; -t | --tag) PACK_ARGS+=("--tag") PACK_ARGS+=("$2") @@ -104,14 +86,6 @@ trigger-builder-pack-builder-build() { PACK_ARGS+=("$2") shift 2 ;; - -B=* | --builder=*) - if [[ "$1" == "--builder=*" ]]; then - PACK_ARGS+=("--builder" "${1#--builder=}") - elif [[ "$1" == "-B=*" ]]; then - PACK_ARGS+=("--builder" "${1#-B=}") - fi - shift 1 - ;; -b=* | --buildpack=*) if [[ "$1" == "--buildpack=*" ]]; then PACK_ARGS+=("--buildpack" "${1#--buildpack=}") @@ -128,14 +102,6 @@ trigger-builder-pack-builder-build() { fi shift 2 ;; - -D=* | --default-process=*) - if [[ "$1" == "--default-process=*" ]]; then - PACK_ARGS+=("--default-process" "${1#--default-process=}") - elif [[ "$1" == "-D=*" ]]; then - PACK_ARGS+=("--default-process" "${1#-D=}") - fi - shift 1 - ;; -d=* | --descriptor=*) if [[ "$1" == "--descriptor=*" ]]; then PACK_ARGS+=("--descriptor" "${1#--descriptor=}") @@ -152,14 +118,6 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; - -p=* | --path=*) - if [[ "$1" == "--path=*" ]]; then - PACK_ARGS+=("--path" "${1#--path=}") - elif [[ "$1" == "-p=*" ]]; then - PACK_ARGS+=("--path" "${1#-p=}") - fi - shift 1 - ;; -t=* | --tag=*) if [[ "$1" == "--tag=*" ]]; then PACK_ARGS+=("--tag" "${1#--tag=}") From 58046ea6dc7d43cb5d663a33379ea674d7c5d9e2 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:28:53 -0500 Subject: [PATCH 03/23] chore: move flags around for better organization --- plugins/builder-pack/builder-build | 68 +++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 7d303a143..237c54bde 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -52,40 +52,6 @@ trigger-builder-pack-builder-build() { PACK_ARGS+=("$2") shift 2 ;; - -r | --buildpack-registry) - PACK_ARGS+=("--buildpack-registry") - PACK_ARGS+=("$2") - shift 2 - ;; - -d | --descriptor) - PACK_ARGS+=("--descriptor") - PACK_ARGS+=("$2") - shift 2 - ;; - -e | --env) - PACK_ARGS+=("--env") - PACK_ARGS+=("$2") - shift 2 - ;; - -t | --tag) - PACK_ARGS+=("--tag") - PACK_ARGS+=("$2") - shift 2 - ;; - --cache | --cache-image | --creation-time | --docker-host | --env-file | --extension | --gid | --insecure-registry | --lifecycle-image | --network | --platform | --post-buildpack | --pre-buildpack | --previous-image | --pull-policy | --report-output-dir | --run-image | --sbom-output-dir | --uid | --workspace) - PACK_ARGS+=("$1") - PACK_ARGS+=("$2") - shift 2 - ;; - --clear-cache | --disable-system-buildpacks | --publish | --trust-builder | --trust-extra-buildpacks | --userns-host) - PACK_ARGS+=("$1") - shift 1 - ;; - --volume | -v) - PACK_ARGS+=("--volume") - PACK_ARGS+=("$2") - shift 2 - ;; -b=* | --buildpack=*) if [[ "$1" == "--buildpack=*" ]]; then PACK_ARGS+=("--buildpack" "${1#--buildpack=}") @@ -94,6 +60,11 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; + -r | --buildpack-registry) + PACK_ARGS+=("--buildpack-registry") + PACK_ARGS+=("$2") + shift 2 + ;; -r=* | --buildpack-registry=*) if [[ "$1" == "--buildpack-registry=*" ]]; then PACK_ARGS+=("--buildpack-registry" "${1#--buildpack-registry=}") @@ -102,6 +73,11 @@ trigger-builder-pack-builder-build() { fi shift 2 ;; + -d | --descriptor) + PACK_ARGS+=("--descriptor") + PACK_ARGS+=("$2") + shift 2 + ;; -d=* | --descriptor=*) if [[ "$1" == "--descriptor=*" ]]; then PACK_ARGS+=("--descriptor" "${1#--descriptor=}") @@ -110,6 +86,11 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; + -e | --env) + PACK_ARGS+=("--env") + PACK_ARGS+=("$2") + shift 2 + ;; -e=* | --env=*) if [[ "$1" == "--env=*" ]]; then PACK_ARGS+=("--env" "${1#--env=}") @@ -118,6 +99,11 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; + -t | --tag) + PACK_ARGS+=("--tag") + PACK_ARGS+=("$2") + shift 2 + ;; -t=* | --tag=*) if [[ "$1" == "--tag=*" ]]; then PACK_ARGS+=("--tag" "${1#--tag=}") @@ -126,6 +112,11 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; + --volume | -v) + PACK_ARGS+=("--volume") + PACK_ARGS+=("$2") + shift 2 + ;; --volume=* | -v=*) if [[ "$1" == "--volume=*" ]]; then PACK_ARGS+=("--volume" "${1#--volume=}") @@ -134,6 +125,15 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; + --cache | --cache-image | --creation-time | --docker-host | --env-file | --extension | --gid | --insecure-registry | --lifecycle-image | --network | --platform | --post-buildpack | --pre-buildpack | --previous-image | --pull-policy | --report-output-dir | --run-image | --sbom-output-dir | --uid | --workspace) + PACK_ARGS+=("$1") + PACK_ARGS+=("$2") + shift 2 + ;; + --clear-cache | --disable-system-buildpacks | --publish | --trust-builder | --trust-extra-buildpacks | --userns-host) + PACK_ARGS+=("$1") + shift 1 + ;; *) continue ;; From a292e41015147673bbe76c274dec64b69c801a76 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:33:03 -0500 Subject: [PATCH 04/23] fix: remove flags that do not make sense in build context --- plugins/builder-pack/builder-build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 237c54bde..59554dada 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -125,7 +125,8 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; - --cache | --cache-image | --creation-time | --docker-host | --env-file | --extension | --gid | --insecure-registry | --lifecycle-image | --network | --platform | --post-buildpack | --pre-buildpack | --previous-image | --pull-policy | --report-output-dir | --run-image | --sbom-output-dir | --uid | --workspace) + --cache | --cache-image | --creation-time | --env-file | --extension | --gid | --insecure-registry | --lifecycle-image | --network | --platform | --post-buildpack | --pre-buildpack | --previous-image | --pull-policy | --run-image | --uid | --workspace) + # todo: additionally support --flag=value syntax PACK_ARGS+=("$1") PACK_ARGS+=("$2") shift 2 From c3d103e46c9b9c5eb65a6ae748058694e5eaf893 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:39:27 -0500 Subject: [PATCH 05/23] fix: remove flag that does not make sense in build context --- plugins/builder-pack/builder-build | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 59554dada..e3d3eef84 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -73,19 +73,6 @@ trigger-builder-pack-builder-build() { fi shift 2 ;; - -d | --descriptor) - PACK_ARGS+=("--descriptor") - PACK_ARGS+=("$2") - shift 2 - ;; - -d=* | --descriptor=*) - if [[ "$1" == "--descriptor=*" ]]; then - PACK_ARGS+=("--descriptor" "${1#--descriptor=}") - elif [[ "$1" == "-d=*" ]]; then - PACK_ARGS+=("--descriptor" "${1#-d=}") - fi - shift 1 - ;; -e | --env) PACK_ARGS+=("--env") PACK_ARGS+=("$2") From 03e90ed2a0678e6576c7da7bce433eb14d6acd75 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:49:48 -0500 Subject: [PATCH 06/23] feat: filter out unsupported build arguments with nixpacks While this will require future updates if nixpacks supports new build arguments, it also ensures builds safely consume arguments from other plugins. --- plugins/builder-nixpacks/builder-build | 132 ++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 5 deletions(-) diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index c27a44921..d2eede6a3 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -35,11 +35,133 @@ trigger-builder-nixpacks-builder-build() { local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") + DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" - # strip --link, --volume and -v args from DOCKER_ARGS - local DOCKER_ARGS=$(sed -e "s/^--link=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--link[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS") - declare -a ARG_ARRAY - eval "ARG_ARRAY=($DOCKER_ARGS)" + DOCKER_ARGS=" $DOCKER_ARGS " + eval set -- "$DOCKER_ARGS" + + declare -a NIXPACKS_ARGS + while true; do + case "$1" in + -t | --tag) + NIXPACKS_ARGS+=("--tag") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -t=* | --tag=*) + if [[ "$1" == "--tag=*" ]]; then + NIXPACKS_ARGS+=("--tag" "${1#--tag=}") + elif [[ "$1" == "-t=*" ]]; then + NIXPACKS_ARGS+=("--tag" "${1#-t=}") + fi + shift 1 + ;; + -i | --install-cmd) + NIXPACKS_ARGS+=("--install-cmd") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -i=* | --install-cmd=*) + if [[ "$1" == "--install-cmd=*" ]]; then + NIXPACKS_ARGS+=("--install-cmd" "${1#--install-cmd=}") + elif [[ "$1" == "-i=*" ]]; then + NIXPACKS_ARGS+=("--install-cmd" "${1#-i=}") + fi + shift 1 + ;; + -l | --label) + NIXPACKS_ARGS+=("--label") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -l=* | --label=*) + if [[ "$1" == "--label=*" ]]; then + NIXPACKS_ARGS+=("--label" "${1#--label=}") + elif [[ "$1" == "-l=*" ]]; then + NIXPACKS_ARGS+=("--label" "${1#-l=}") + fi + shift 1 + ;; + -b | --build-cmd) + NIXPACKS_ARGS+=("--build-cmd") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -b=* | --build-cmd=*) + if [[ "$1" == "--build-cmd=*" ]]; then + NIXPACKS_ARGS+=("--build-cmd" "${1#--build-cmd=}") + elif [[ "$1" == "-b=*" ]]; then + NIXPACKS_ARGS+=("--build-cmd" "${1#-b=}") + fi + shift 1 + ;; + -s | --start-cmd) + NIXPACKS_ARGS+=("--start-cmd") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -s=* | --start-cmd=*) + if [[ "$1" == "--start-cmd=*" ]]; then + NIXPACKS_ARGS+=("--start-cmd" "${1#--start-cmd=}") + elif [[ "$1" == "-s=*" ]]; then + NIXPACKS_ARGS+=("--start-cmd" "${1#-s=}") + fi + shift 1 + ;; + -p | --pkgs) + NIXPACKS_ARGS+=("--pkgs") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -p=* | --pkgs=*) + if [[ "$1" == "--pkgs=*" ]]; then + NIXPACKS_ARGS+=("--pkgs" "${1#--pkgs=}") + elif [[ "$1" == "-p=*" ]]; then + NIXPACKS_ARGS+=("--pkgs" "${1#-p=}") + fi + shift 1 + ;; + -a | --apt) + NIXPACKS_ARGS+=("--apt") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -a=* | --apt=*) + if [[ "$1" == "--apt=*" ]]; then + NIXPACKS_ARGS+=("--apt" "${1#--apt=}") + elif [[ "$1" == "-a=*" ]]; then + NIXPACKS_ARGS+=("--apt" "${1#-a=}") + fi + shift 1 + ;; + -e | --env) + NIXPACKS_ARGS+=("--env") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + -e=* | --env=*) + if [[ "$1" == "--env=*" ]]; then + NIXPACKS_ARGS+=("--env" "${1#--env=}") + elif [[ "$1" == "-e=*" ]]; then + NIXPACKS_ARGS+=("--env" "${1#-e=}") + fi + shift 1 + ;; + --platform | --cache-key | --incremental-cache-image | --libs | --cache-from | --docker-host | --add-host | --docker-tls-verify) + # todo: additionally support --flag=value syntax + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --no-cache | --inline-cache | --no-error-without-start) + NIXPACKS_ARGS+=("$1") + shift 1 + ;; + *) + continue + ;; + esac + done eval "$(config_export app "$APP" --merged)" @@ -50,7 +172,7 @@ trigger-builder-nixpacks-builder-build() { fi # shellcheck disable=SC2086 - if ! nixpacks build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS "${ARG_ARRAY[@]}" $NIXPACKS_ARGS --name "$IMAGE" "$SOURCECODE_WORK_DIR"; then + if ! nixpacks build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${NIXPACKS_ARGS[@]}" --name "$IMAGE" "$SOURCECODE_WORK_DIR"; then dokku_log_warn "Failure building image" return 1 fi From 11c2497b311ed5a1b81ae3d903587f5d0502b774 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:59:12 -0500 Subject: [PATCH 07/23] feat: filter out unsupported build arguments with railpacks While this will require future updates if railpacks supports new build arguments, it also ensures builds safely consume arguments from other plugins. --- plugins/builder-railpack/builder-build | 121 +++++++++++++++++++++---- 1 file changed, 104 insertions(+), 17 deletions(-) diff --git a/plugins/builder-railpack/builder-build b/plugins/builder-railpack/builder-build index e0716522d..5d4c8faf0 100755 --- a/plugins/builder-railpack/builder-build +++ b/plugins/builder-railpack/builder-build @@ -27,30 +27,117 @@ trigger-builder-railpack-builder-build() { plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" - no_cache="$(fn-builder-railpack-computed-no-cache "$APP")" - RAILPACK_ARGS="" - if [[ "$no_cache" == "true" ]]; then - RAILPACK_ARGS="$RAILPACK_ARGS --no-cache" - fi - - local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") - DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") - - # strip --link, --volume and -v args from DOCKER_ARGS - local DOCKER_ARGS=$(sed -e "s/^--link=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--link[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS") - declare -a ARG_ARRAY - eval "ARG_ARRAY=($DOCKER_ARGS)" - - eval "$(config_export app "$APP" --merged)" - if [[ -f "$SOURCECODE_WORK_DIR/Procfile" ]]; then if procfile-util exists --process-type release; then procfile-util delete --process-type release fi fi + local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") + DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") + [[ "$(fn-builder-railpack-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache" + + DOCKER_ARGS=" $DOCKER_ARGS " + eval set -- "$DOCKER_ARGS" + + declare -a RAILPACK_ARGS + while true; do + case "$1" in + --platform) + RAILPACK_ARGS+=("--platform") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + --platform=*) + if [[ "$1" == "--buildpack=*" ]]; then + RAILPACK_ARGS+=("--platform" "${1#--platform=}") + elif [[ "$1" == "--platform=*" ]]; then + RAILPACK_ARGS+=("--platform" "${1#--platform=}") + fi + shift 1 + ;; + --progress) + RAILPACK_ARGS+=("--progress") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + --progress=*) + if [[ "$1" == "--progress=*" ]]; then + RAILPACK_ARGS+=("--progress" "${1#--progress=}") + fi + shift 1 + ;; + --cache-key) + RAILPACK_ARGS+=("--cache-key") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + --cache-key=*) + if [[ "$1" == "--cache-key=*" ]]; then + RAILPACK_ARGS+=("--cache-key" "${1#--cache-key=}") + fi + shift 1 + ;; + -e | --env) + RAILPACK_ARGS+=("--env") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + -e=* | --env=*) + if [[ "$1" == "--env=*" ]]; then + RAILPACK_ARGS+=("--env" "${1#--env=}") + elif [[ "$1" == "--env=*" ]]; then + RAILPACK_ARGS+=("--env" "${1#--env=}") + fi + shift 1 + ;; + --previous) + RAILPACK_ARGS+=("--previous") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + --previous=*) + if [[ "$1" == "--previous=*" ]]; then + RAILPACK_ARGS+=("--previous" "${1#--previous=}") + fi + shift 1 + ;; + --build-cmd) + RAILPACK_ARGS+=("--build-cmd") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + --build-cmd=*) + if [[ "$1" == "--build-cmd=*" ]]; then + RAILPACK_ARGS+=("--build-cmd" "${1#--build-cmd=}") + fi + shift 1 + ;; + --start-cmd) + RAILPACK_ARGS+=("--start-cmd") + RAILPACK_ARGS+=("$2") + shift 2 + ;; + --start-cmd=*) + if [[ "$1" == "--start-cmd=*" ]]; then + RAILPACK_ARGS+=("--start-cmd" "${1#--start-cmd=}") + fi + shift 1 + ;; + ---show-plan | --error-missing-start) + RAILPACK_ARGS+=("$1") + shift 1 + ;; + *) + continue + ;; + esac + done + + eval "$(config_export app "$APP" --merged)" + # shellcheck disable=SC2086 - if ! railpack build "${ARG_ARRAY[@]}" $RAILPACK_ARGS --name "$IMAGE-build" "$SOURCECODE_WORK_DIR"; then + if ! railpack build "${RAILPACK_ARGS[@]}" --name "$IMAGE-build" "$SOURCECODE_WORK_DIR"; then dokku_log_warn "Failure building image" return 1 fi From ae8eaa7e63e88c9f05569265c6ce39dc58c16176 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 22:59:49 -0500 Subject: [PATCH 08/23] refactor: filter out procfile first and include --no-cache in DOCKER_ARGS --- plugins/builder-nixpacks/builder-build | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index d2eede6a3..d1ab7340e 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -27,15 +27,16 @@ trigger-builder-nixpacks-builder-build() { plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" - no_cache="$(fn-builder-nixpacks-computed-no-cache "$APP")" - NIXPACKS_ARGS="" - if [[ "$no_cache" == "true" ]]; then - NIXPACKS_ARGS="$NIXPACKS_ARGS --no-cache" + if [[ -f "$SOURCECODE_WORK_DIR/Procfile" ]]; then + if procfile-util exists --process-type release; then + procfile-util delete --process-type release + fi fi local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" + [[ "$(fn-builder-nixpacks-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache" DOCKER_ARGS=" $DOCKER_ARGS " eval set -- "$DOCKER_ARGS" @@ -165,12 +166,6 @@ trigger-builder-nixpacks-builder-build() { eval "$(config_export app "$APP" --merged)" - if [[ -f "$SOURCECODE_WORK_DIR/Procfile" ]]; then - if procfile-util exists --process-type release; then - procfile-util delete --process-type release - fi - fi - # shellcheck disable=SC2086 if ! nixpacks build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${NIXPACKS_ARGS[@]}" --name "$IMAGE" "$SOURCECODE_WORK_DIR"; then dokku_log_warn "Failure building image" From 210128f5f25baf494c51b5c076e2552e8dfc66b3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:13:57 -0500 Subject: [PATCH 09/23] chore: simplify logic for flags without multiple methods of being set --- plugins/builder-railpack/builder-build | 30 +++++++------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/plugins/builder-railpack/builder-build b/plugins/builder-railpack/builder-build index 5d4c8faf0..68d2698f3 100755 --- a/plugins/builder-railpack/builder-build +++ b/plugins/builder-railpack/builder-build @@ -49,11 +49,7 @@ trigger-builder-railpack-builder-build() { shift 2 ;; --platform=*) - if [[ "$1" == "--buildpack=*" ]]; then - RAILPACK_ARGS+=("--platform" "${1#--platform=}") - elif [[ "$1" == "--platform=*" ]]; then - RAILPACK_ARGS+=("--platform" "${1#--platform=}") - fi + RAILPACK_ARGS+=("--platform" "${1#--platform=}") shift 1 ;; --progress) @@ -62,9 +58,7 @@ trigger-builder-railpack-builder-build() { shift 2 ;; --progress=*) - if [[ "$1" == "--progress=*" ]]; then - RAILPACK_ARGS+=("--progress" "${1#--progress=}") - fi + RAILPACK_ARGS+=("--progress" "${1#--progress=}") shift 1 ;; --cache-key) @@ -73,9 +67,7 @@ trigger-builder-railpack-builder-build() { shift 2 ;; --cache-key=*) - if [[ "$1" == "--cache-key=*" ]]; then - RAILPACK_ARGS+=("--cache-key" "${1#--cache-key=}") - fi + RAILPACK_ARGS+=("--cache-key" "${1#--cache-key=}") shift 1 ;; -e | --env) @@ -86,8 +78,8 @@ trigger-builder-railpack-builder-build() { -e=* | --env=*) if [[ "$1" == "--env=*" ]]; then RAILPACK_ARGS+=("--env" "${1#--env=}") - elif [[ "$1" == "--env=*" ]]; then - RAILPACK_ARGS+=("--env" "${1#--env=}") + elif [[ "$1" == "--e=*" ]]; then + RAILPACK_ARGS+=("--env" "${1#-e=}") fi shift 1 ;; @@ -97,9 +89,7 @@ trigger-builder-railpack-builder-build() { shift 2 ;; --previous=*) - if [[ "$1" == "--previous=*" ]]; then - RAILPACK_ARGS+=("--previous" "${1#--previous=}") - fi + RAILPACK_ARGS+=("--previous" "${1#--previous=}") shift 1 ;; --build-cmd) @@ -108,9 +98,7 @@ trigger-builder-railpack-builder-build() { shift 2 ;; --build-cmd=*) - if [[ "$1" == "--build-cmd=*" ]]; then - RAILPACK_ARGS+=("--build-cmd" "${1#--build-cmd=}") - fi + RAILPACK_ARGS+=("--build-cmd" "${1#--build-cmd=}") shift 1 ;; --start-cmd) @@ -119,9 +107,7 @@ trigger-builder-railpack-builder-build() { shift 2 ;; --start-cmd=*) - if [[ "$1" == "--start-cmd=*" ]]; then - RAILPACK_ARGS+=("--start-cmd" "${1#--start-cmd=}") - fi + RAILPACK_ARGS+=("--start-cmd" "${1#--start-cmd=}") shift 1 ;; ---show-plan | --error-missing-start) From 2a702175b55d490fe0e6a1ea8e7b097eb6bc7b20 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:17:48 -0500 Subject: [PATCH 10/23] feat: filter out unsupported build arguments with docker build While this will require future updates if docker supports new build arguments, it also ensures builds safely consume arguments from other plugins. --- plugins/builder-dockerfile/builder-build | 215 ++++++++++++++++++++++- 1 file changed, 208 insertions(+), 7 deletions(-) diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 08a0d5d10..22ed24709 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -17,7 +17,6 @@ trigger-builder-dockerfile-builder-build() { dokku_log_info1 "Building $APP from Dockerfile" local IMAGE=$(get_app_image_name "$APP") - local DOKKU_DOCKERFILE_CACHE_BUILD=$(config_get "$APP" "DOKKU_DOCKERFILE_CACHE_BUILD") local DOKKU_DOCKER_BUILD_OPTS=$(config_get "$APP" "DOKKU_DOCKER_BUILD_OPTS") local DOCKER_BUILD_LABEL_ARGS=("--label=dokku" "--label=org.label-schema.schema-version=1.0" "--label=org.label-schema.vendor=dokku" "--label=com.dokku.image-stage=build" "--label=com.dokku.builder-type=dockerfile" "--label=com.dokku.app-name=$APP") @@ -34,17 +33,219 @@ trigger-builder-dockerfile-builder-build() { fi plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" - [[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache" local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") + DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" + [[ "$(config_get "$APP" "DOKKU_DOCKERFILE_CACHE_BUILD")" == "false" ]] && DOCKER_ARGS+=" --no-cache" - # strip --link, --volume and -v args from DOCKER_ARGS - local DOCKER_ARGS=$(sed -e "s/^--link=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--link[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS") - declare -a ARG_ARRAY - eval "ARG_ARRAY=($DOCKER_ARGS)" + + DOCKER_ARGS=" $DOCKER_ARGS " + eval set -- "$DOCKER_ARGS" + + declare -a DOCKERFILE_ARGS + while true; do + case "$1" in + --add-host) + DOCKERFILE_ARGS+=("--add-host") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --add-host=*) + DOCKERFILE_ARGS+=("--add-host" "${1#--add-host=}") + shift 1 + ;; + --allow) + DOCKERFILE_ARGS+=("--allow") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --allow=*) + DOCKERFILE_ARGS+=("--allow" "${1#--allow=}") + shift 1 + ;; + --annotation) + DOCKERFILE_ARGS+=("--annotation") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --annotation=*) + DOCKERFILE_ARGS+=("--annotation" "${1#--annotation=}") + shift 1 + ;; + --attest) + DOCKERFILE_ARGS+=("--attest") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --attest=*) + DOCKERFILE_ARGS+=("--attest" "${1#--attest=}") + shift 1 + ;; + --build-arg) + DOCKERFILE_ARGS+=("--build-arg") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --build-arg=*) + DOCKERFILE_ARGS+=("--build-arg" "${1#--build-arg=}") + shift 1 + ;; + --builder) + DOCKERFILE_ARGS+=("--builder") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --builder=*) + DOCKERFILE_ARGS+=("--builder" "${1#--builder=}") + shift 1 + ;; + --cache-from) + DOCKERFILE_ARGS+=("--cache-from") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --cache-from=*) + DOCKERFILE_ARGS+=("--cache-from" "${1#--cache-from=}") + shift 1 + ;; + --cache-to) + DOCKERFILE_ARGS+=("--cache-to") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --cache-to=*) + DOCKERFILE_ARGS+=("--cache-to" "${1#--cache-to=}") + shift 1 + ;; + --call) + DOCKERFILE_ARGS+=("--env") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --env=*) + DOCKERFILE_ARGS+=("--env" "${1#--env=}") + shift 1 + ;; + --cgroup-parent) + DOCKERFILE_ARGS+=("--cgroup-parent") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --cgroup-parent=*) + DOCKERFILE_ARGS+=("--cgroup-parent" "${1#--cgroup-parent=}") + shift 1 + ;; + --label) + DOCKERFILE_ARGS+=("--label") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --label=*) + DOCKERFILE_ARGS+=("--label" "${1#--label=}") + shift 1 + ;; + --network) + DOCKERFILE_ARGS+=("--network") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --network=*) + DOCKERFILE_ARGS+=("--network" "${1#--network=}") + shift 1 + ;; + --platform) + DOCKERFILE_ARGS+=("--platform") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --platform=*) + DOCKERFILE_ARGS+=("--platform" "${1#--platform=}") + shift 1 + ;; + --progress) + DOCKERFILE_ARGS+=("--progress") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --progress=*) + DOCKERFILE_ARGS+=("--progress" "${1#--progress=}") + shift 1 + ;; + --provenance) + DOCKERFILE_ARGS+=("--provenance") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --provenance=*) + DOCKERFILE_ARGS+=("--provenance" "${1#--provenance=}") + shift 1 + ;; + --sbom) + DOCKERFILE_ARGS+=("--sbom") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --sbom=*) + DOCKERFILE_ARGS+=("--sbom" "${1#--sbom=}") + shift 1 + ;; + --secret) + DOCKERFILE_ARGS+=("--secret") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --secret=*) + DOCKERFILE_ARGS+=("--secret" "${1#--secret=}") + shift 1 + ;; + --shm-size) + DOCKERFILE_ARGS+=("--shm-size") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --shm-size=*) + DOCKERFILE_ARGS+=("--shm-size" "${1#--shm-size=}") + shift 1 + ;; + --ssh) + DOCKERFILE_ARGS+=("--platform") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --ssh=*) + DOCKERFILE_ARGS+=("--ssh" "${1#--ssh=}") + shift 1 + ;; + --target) + DOCKERFILE_ARGS+=("--target") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --target=*) + DOCKERFILE_ARGS+=("--target" "${1#--target=}") + shift 1 + ;; + --ulimit) + DOCKERFILE_ARGS+=("--tag") + DOCKERFILE_ARGS+=("$2") + shift 2 + ;; + --tag=*) + DOCKERFILE_ARGS+=("--tag" "${1#--tag=}") + shift 1 + ;; + --check | -D | --debug | --no-cache) + DOCKERFILE_ARGS+=("$1") + shift 1 + ;; + *) + continue + ;; + esac + done eval "$(config_export app "$APP")" - "$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS "${ARG_ARRAY[@]}" ${DOKKU_DOCKER_BUILD_OPTS} -t $IMAGE . + "$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${DOCKERFILE_ARGS[@]}" ${DOKKU_DOCKER_BUILD_OPTS} --tag $IMAGE . plugn trigger ports-set-detected "$APP" "$(fn-builder-dockerfile-get-detect-port-map "$APP" "$IMAGE" "$SOURCECODE_WORK_DIR/Dockerfile")" if fn-plugn-trigger-exists "post-build-dockerfile"; then From 6325dd6d7bf7a0d8498cad8a82f5f78ee656d3c6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:21:41 -0500 Subject: [PATCH 11/23] docs: add missing link to 0.36.0 migration guide --- docs/getting-started/upgrading/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/getting-started/upgrading/index.md b/docs/getting-started/upgrading/index.md index 7effb6010..166bea94b 100644 --- a/docs/getting-started/upgrading/index.md +++ b/docs/getting-started/upgrading/index.md @@ -18,6 +18,7 @@ Docker releases updates periodically to their engine. We recommend reading their Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded. +- [Upgrading to 0.36](/docs/appendices/0.36.0-migration-guide.md) - [Upgrading to 0.35](/docs/appendices/0.35.0-migration-guide.md) - [Upgrading to 0.34](/docs/appendices/0.34.0-migration-guide.md) - [Upgrading to 0.33](/docs/appendices/0.33.0-migration-guide.md) From 9b75cc39b1ebb527f7fa81d5c69cbaf51718be33 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:27:22 -0500 Subject: [PATCH 12/23] refactor: remove support for DOKKU_DOCKERFILE_CACHE_BUILD This replicates the docker-options functionality. --- docs/appendices/0.37.0-migration-guide.md | 5 +++++ docs/configuration/environment-variables.md | 1 - docs/deployment/builders/dockerfiles.md | 2 +- docs/getting-started/upgrading/index.md | 1 + plugins/builder-dockerfile/builder-build | 1 - 5 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 docs/appendices/0.37.0-migration-guide.md diff --git a/docs/appendices/0.37.0-migration-guide.md b/docs/appendices/0.37.0-migration-guide.md new file mode 100644 index 000000000..c7a07eee8 --- /dev/null +++ b/docs/appendices/0.37.0-migration-guide.md @@ -0,0 +1,5 @@ +# 0.36.0 Migration Guide + +## Removals + +- Support for the `DOKKU_DOCKERFILE_CACHE_BUILD` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead. \ No newline at end of file diff --git a/docs/configuration/environment-variables.md b/docs/configuration/environment-variables.md index d2c21fd50..dd805bd0f 100644 --- a/docs/configuration/environment-variables.md +++ b/docs/configuration/environment-variables.md @@ -110,7 +110,6 @@ The following config variables have special meanings and can be set in a variety | `DOKKU_DEFAULT_CHECKS_WAIT` | `10` | `dokku config:set` | If no user-defined checks are specified - or if the process being checked is not a `web` process - this is the period of time Dokku will wait before checking that a container is still running. | | `DOKKU_DISABLE_PROXY` | none | `dokku proxy:disable`
`dokku proxy:enable` | Disables the proxy in front of your application, resulting in publicly routing the docker container. | | `DOKKU_DISABLE_APP_AUTOCREATION` | none | `dokku config:set` | Disables automatic creation of a non-existent app on deploy. | -| `DOKKU_DOCKERFILE_CACHE_BUILD` | none | `dokku config:set` | | | `DOKKU_DOCKERFILE_START_CMD` | none | `dokku config:set` | | | `DOKKU_PARALLEL_ARGUMENTS`. | none | `dokku config:set` | Allows passing custom arguments to parallel for `ps:*all` commands | | `DOKKU_PROXY_PORT` | automatically assigned | `/etc/environment`
`~dokku/.dokkurc`
`~dokku/.dokkurc/*`
`dokku config:set` | | diff --git a/docs/deployment/builders/dockerfiles.md b/docs/deployment/builders/dockerfiles.md index 64b3c4726..a7a49b080 100644 --- a/docs/deployment/builders/dockerfiles.md +++ b/docs/deployment/builders/dockerfiles.md @@ -199,7 +199,7 @@ dokku config:set node-js-app DOKKU_DOCKERFILE_START_CMD="--harmony server.js" To tell Docker what to run. -Setting `$DOKKU_DOCKERFILE_CACHE_BUILD` to `true` or `false` will enable or disable Docker's image layer cache. Lastly, for more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`. +For more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`. ### Procfiles and multiple processes diff --git a/docs/getting-started/upgrading/index.md b/docs/getting-started/upgrading/index.md index 166bea94b..7c3ae989d 100644 --- a/docs/getting-started/upgrading/index.md +++ b/docs/getting-started/upgrading/index.md @@ -18,6 +18,7 @@ Docker releases updates periodically to their engine. We recommend reading their Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded. +- [Upgrading to 0.37](/docs/appendices/0.37.0-migration-guide.md) - [Upgrading to 0.36](/docs/appendices/0.36.0-migration-guide.md) - [Upgrading to 0.35](/docs/appendices/0.35.0-migration-guide.md) - [Upgrading to 0.34](/docs/appendices/0.34.0-migration-guide.md) diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 22ed24709..5916461f3 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -36,7 +36,6 @@ trigger-builder-dockerfile-builder-build() { local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" - [[ "$(config_get "$APP" "DOKKU_DOCKERFILE_CACHE_BUILD")" == "false" ]] && DOCKER_ARGS+=" --no-cache" DOCKER_ARGS=" $DOCKER_ARGS " From 50b2836e52ac6c902c1d0116bf94b2b68cf0ef40 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:28:44 -0500 Subject: [PATCH 13/23] refactor: remove support for DOKKU_DOCKER_BUILD_OPTS This replicates the docker-options functionality. --- docs/appendices/0.37.0-migration-guide.md | 3 ++- docs/deployment/builders/dockerfiles.md | 2 -- plugins/builder-dockerfile/builder-build | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/appendices/0.37.0-migration-guide.md b/docs/appendices/0.37.0-migration-guide.md index c7a07eee8..bc7943389 100644 --- a/docs/appendices/0.37.0-migration-guide.md +++ b/docs/appendices/0.37.0-migration-guide.md @@ -2,4 +2,5 @@ ## Removals -- Support for the `DOKKU_DOCKERFILE_CACHE_BUILD` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead. \ No newline at end of file +- Support for the `DOKKU_DOCKERFILE_CACHE_BUILD` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead. +- Support for the `DOKKU_DOCKER_BUILD_OPTS` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead. diff --git a/docs/deployment/builders/dockerfiles.md b/docs/deployment/builders/dockerfiles.md index a7a49b080..ec1b7b5ee 100644 --- a/docs/deployment/builders/dockerfiles.md +++ b/docs/deployment/builders/dockerfiles.md @@ -199,8 +199,6 @@ dokku config:set node-js-app DOKKU_DOCKERFILE_START_CMD="--harmony server.js" To tell Docker what to run. -For more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`. - ### Procfiles and multiple processes > [!IMPORTANT] diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 5916461f3..56852547c 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -17,7 +17,6 @@ trigger-builder-dockerfile-builder-build() { dokku_log_info1 "Building $APP from Dockerfile" local IMAGE=$(get_app_image_name "$APP") - local DOKKU_DOCKER_BUILD_OPTS=$(config_get "$APP" "DOKKU_DOCKER_BUILD_OPTS") local DOCKER_BUILD_LABEL_ARGS=("--label=dokku" "--label=org.label-schema.schema-version=1.0" "--label=org.label-schema.vendor=dokku" "--label=com.dokku.image-stage=build" "--label=com.dokku.builder-type=dockerfile" "--label=com.dokku.app-name=$APP") pushd "$SOURCECODE_WORK_DIR" &>/dev/null @@ -244,7 +243,7 @@ trigger-builder-dockerfile-builder-build() { done eval "$(config_export app "$APP")" - "$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${DOCKERFILE_ARGS[@]}" ${DOKKU_DOCKER_BUILD_OPTS} --tag $IMAGE . + "$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${DOCKERFILE_ARGS[@]}" --tag $IMAGE . plugn trigger ports-set-detected "$APP" "$(fn-builder-dockerfile-get-detect-port-map "$APP" "$IMAGE" "$SOURCECODE_WORK_DIR/Dockerfile")" if fn-plugn-trigger-exists "post-build-dockerfile"; then From 93cf9cc1189d8d020d259d5dcd0d6957b72cec81 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:30:15 -0500 Subject: [PATCH 14/23] refactor: remove support for the nixpacks no-cache property This replicates the docker-options functionality. --- docs/deployment/builders/nixpacks.md | 38 +++------------------ plugins/builder-nixpacks/builder-build | 1 - plugins/builder-nixpacks/internal-functions | 26 -------------- plugins/builder-nixpacks/subcommands/set | 4 +-- 4 files changed, 6 insertions(+), 63 deletions(-) diff --git a/docs/deployment/builders/nixpacks.md b/docs/deployment/builders/nixpacks.md index 46559ca68..945b424c3 100644 --- a/docs/deployment/builders/nixpacks.md +++ b/docs/deployment/builders/nixpacks.md @@ -80,28 +80,10 @@ dokku builder-nixpacks:set --global nixpackstoml-path ### Disabling cache -Cache is enabled by default, but can be disabled by setting the `no-cache` property to `true`: +Disable cache using the [docker-options] plugin: ```shell -dokku builder-nixpacks:set node-js-app no-cache true -``` - -The default value may be set by passing an empty value for the option: - -```shell -dokku builder-nixpacks:set node-js-app no-cache -``` - -The `no-cache` property can also be set globally. The global default is `false`, and the global value is used when no app-specific value is set. - -```shell -dokku builder-nixpacks:set --global no-cache true -``` - -The default value may be set by passing an empty value for the option. - -```shell -dokku builder-nixpacks:set --global no-cache +dokku docker-options:add node-js-app build "--no-cache" ``` ### Displaying builder-nixpacks reports for an app @@ -117,23 +99,14 @@ dokku builder-nixpacks:report Builder-nixpacks computed nixpackstoml path: nixpacks2.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: nixpacks2.toml - Builder-nixpacks computed no cache: true - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: true =====> python-sample builder-nixpacks information Builder-nixpacks computed nixpackstoml path: nixpacks.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: - Builder-nixpacks computed no cache: false - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: =====> ruby-sample builder-nixpacks information Builder-nixpacks computed nixpackstoml path: nixpacks.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: - Builder-nixpacks computed no cache: false - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: ``` You can run the command for a specific app also. @@ -147,17 +120,14 @@ dokku builder-nixpacks:report node-js-app Builder-nixpacks computed nixpackstoml path: nixpacks2.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: nixpacks2.toml - Builder-nixpacks computed no cache: true - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: true ``` You can pass flags which will output only the value of the specific information you want. For example: ```shell -dokku builder-nixpacks:report node-js-app --builder-nixpacks-no-cache +dokku builder-nixpacks:report node-js-app --builder-nixpacks-nixpackstoml-path ``` ``` -true +nixpacks2.toml ``` diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index d1ab7340e..d7fa62820 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -36,7 +36,6 @@ trigger-builder-nixpacks-builder-build() { local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" - [[ "$(fn-builder-nixpacks-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache" DOCKER_ARGS=" $DOCKER_ARGS " eval set -- "$DOCKER_ARGS" diff --git a/plugins/builder-nixpacks/internal-functions b/plugins/builder-nixpacks/internal-functions index 582fc33fa..d2c60a133 100755 --- a/plugins/builder-nixpacks/internal-functions +++ b/plugins/builder-nixpacks/internal-functions @@ -38,9 +38,6 @@ cmd-builder-nixpacks-report-single() { "--builder-nixpacks-computed-nixpackstoml-path: $(fn-builder-nixpacks-computed-nixpackstoml-path "$APP")" "--builder-nixpacks-global-nixpackstoml-path: $(fn-builder-nixpacks-global-nixpackstoml-path "$APP")" "--builder-nixpacks-nixpackstoml-path: $(fn-builder-nixpacks-nixpackstoml-path "$APP")" - "--builder-nixpacks-computed-no-cache: $(fn-builder-nixpacks-computed-no-cache "$APP")" - "--builder-nixpacks-global-no-cache: $(fn-builder-nixpacks-global-no-cache "$APP")" - "--builder-nixpacks-no-cache: $(fn-builder-nixpacks-no-cache "$APP")" ) if [[ -z "$INFO_FLAG" ]]; then @@ -91,26 +88,3 @@ fn-builder-nixpacks-nixpackstoml-path() { fn-plugin-property-get "builder-nixpacks" "$APP" "nixpackstoml-path" "" } - -fn-builder-nixpacks-computed-no-cache() { - declare APP="$1" - - file="$(fn-builder-nixpacks-no-cache "$APP")" - if [[ "$file" == "" ]]; then - file="$(fn-builder-nixpacks-global-no-cache "$APP")" - fi - - echo "$file" -} - -fn-builder-nixpacks-global-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-nixpacks" "--global" "no-cache" "false" -} - -fn-builder-nixpacks-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-nixpacks" "$APP" "no-cache" "" -} diff --git a/plugins/builder-nixpacks/subcommands/set b/plugins/builder-nixpacks/subcommands/set index 711b60d72..de7d46513 100755 --- a/plugins/builder-nixpacks/subcommands/set +++ b/plugins/builder-nixpacks/subcommands/set @@ -9,13 +9,13 @@ cmd-builder-nixpacks-set() { declare cmd="builder-nixpacks:set" [[ "$1" == "$cmd" ]] && shift 1 declare APP="$1" KEY="$2" VALUE="$3" - local VALID_KEYS=("nixpackstoml-path" "no-cache") + local VALID_KEYS=("nixpackstoml-path") [[ "$APP" == "--global" ]] || verify_app_name "$APP" [[ -z "$KEY" ]] && dokku_log_fail "No key specified" if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then - dokku_log_fail "Invalid key specified, valid keys include: nixpackstoml-path, no-cache" + dokku_log_fail "Invalid key specified, valid keys include: nixpackstoml-path" fi if [[ -n "$VALUE" ]]; then From 364eac374d80c7a3101aab1cf743c66cf06423ee Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:30:24 -0500 Subject: [PATCH 15/23] refactor: remove support for the railpack no-cache property This replicates the docker-options functionality. --- docs/deployment/builders/railpack.md | 38 +++------------------ plugins/builder-railpack/builder-build | 1 - plugins/builder-railpack/internal-functions | 26 -------------- plugins/builder-railpack/subcommands/set | 4 +-- 4 files changed, 6 insertions(+), 63 deletions(-) diff --git a/docs/deployment/builders/railpack.md b/docs/deployment/builders/railpack.md index dc0d634fb..cde329846 100644 --- a/docs/deployment/builders/railpack.md +++ b/docs/deployment/builders/railpack.md @@ -89,28 +89,10 @@ dokku builder-railpack:set --global railpackjson-path ### Disabling cache -Cache is enabled by default, but can be disabled by setting the `no-cache` property to `true`: +Disable cache using the [docker-options] plugin: ```shell -dokku builder-railpack:set node-js-app no-cache true -``` - -The default value may be set by passing an empty value for the option: - -```shell -dokku builder-railpack:set node-js-app no-cache -``` - -The `no-cache` property can also be set globally. The global default is `false`, and the global value is used when no app-specific value is set. - -```shell -dokku builder-railpack:set --global no-cache true -``` - -The default value may be set by passing an empty value for the option. - -```shell -dokku builder-railpack:set --global no-cache +dokku docker-options:add node-js-app build "--no-cache" ``` ### Displaying builder-railpack reports for an app @@ -126,23 +108,14 @@ dokku builder-railpack:report Builder-railpack computed railpackjson path: railpack2.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: railpack2.json - Builder-railpack computed no cache: true - Builder-railpack global no cache: false - Builder-railpack no cache: true =====> python-sample builder-railpack information Builder-railpack computed railpackjson path: railpack.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: - Builder-railpack computed no cache: false - Builder-railpack global no cache: false - Builder-railpack no cache: =====> ruby-sample builder-railpack information Builder-railpack computed railpackjson path: railpack.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: - Builder-railpack computed no cache: false - Builder-railpack global no cache: false - Builder-railpack no cache: ``` You can run the command for a specific app also. @@ -156,17 +129,14 @@ dokku builder-railpack:report node-js-app Builder-railpack computed railpackjson path: railpack2.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: railpack2.json - Builder-railpack computed no cache: true - Builder-railpack global no cache: false - Builder-railpack no cache: true ``` You can pass flags which will output only the value of the specific information you want. For example: ```shell -dokku builder-railpack:report node-js-app --builder-railpack-no-cache +dokku builder-railpack:report node-js-app --builder-railpack-railpackjson-path ``` ``` -true +railpack2.json ``` diff --git a/plugins/builder-railpack/builder-build b/plugins/builder-railpack/builder-build index 68d2698f3..afc5ff65f 100755 --- a/plugins/builder-railpack/builder-build +++ b/plugins/builder-railpack/builder-build @@ -35,7 +35,6 @@ trigger-builder-railpack-builder-build() { local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") - [[ "$(fn-builder-railpack-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache" DOCKER_ARGS=" $DOCKER_ARGS " eval set -- "$DOCKER_ARGS" diff --git a/plugins/builder-railpack/internal-functions b/plugins/builder-railpack/internal-functions index a405b2ed0..96dab71bc 100755 --- a/plugins/builder-railpack/internal-functions +++ b/plugins/builder-railpack/internal-functions @@ -38,9 +38,6 @@ cmd-builder-railpack-report-single() { "--builder-railpack-computed-railpackjson-path: $(fn-builder-railpack-computed-railpackjson-path "$APP")" "--builder-railpack-global-railpackjson-path: $(fn-builder-railpack-global-railpackjson-path "$APP")" "--builder-railpack-railpackjson-path: $(fn-builder-railpack-railpackjson-path "$APP")" - "--builder-railpack-computed-no-cache: $(fn-builder-railpack-computed-no-cache "$APP")" - "--builder-railpack-global-no-cache: $(fn-builder-railpack-global-no-cache "$APP")" - "--builder-railpack-no-cache: $(fn-builder-railpack-no-cache "$APP")" ) if [[ -z "$INFO_FLAG" ]]; then @@ -91,26 +88,3 @@ fn-builder-railpack-railpackjson-path() { fn-plugin-property-get "builder-railpack" "$APP" "railpackjson-path" "" } - -fn-builder-railpack-computed-no-cache() { - declare APP="$1" - - file="$(fn-builder-railpack-no-cache "$APP")" - if [[ "$file" == "" ]]; then - file="$(fn-builder-railpack-global-no-cache "$APP")" - fi - - echo "$file" -} - -fn-builder-railpack-global-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-railpack" "--global" "no-cache" "false" -} - -fn-builder-railpack-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-railpack" "$APP" "no-cache" "" -} diff --git a/plugins/builder-railpack/subcommands/set b/plugins/builder-railpack/subcommands/set index 6001f0c6f..3ac35030d 100755 --- a/plugins/builder-railpack/subcommands/set +++ b/plugins/builder-railpack/subcommands/set @@ -9,13 +9,13 @@ cmd-builder-railpack-set() { declare cmd="builder-railpack:set" [[ "$1" == "$cmd" ]] && shift 1 declare APP="$1" KEY="$2" VALUE="$3" - local VALID_KEYS=("railpackjson-path" "no-cache") + local VALID_KEYS=("railpackjson-path") [[ "$APP" == "--global" ]] || verify_app_name "$APP" [[ -z "$KEY" ]] && dokku_log_fail "No key specified" if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then - dokku_log_fail "Invalid key specified, valid keys include: railpackjson-path, no-cache" + dokku_log_fail "Invalid key specified, valid keys include: railpackjson-path" fi if [[ -n "$VALUE" ]]; then From 397c8f6d150dbd241458ba182336e75d30a54764 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:31:00 -0500 Subject: [PATCH 16/23] docs: add note on removal of nixpacks no-cache property --- docs/appendices/0.37.0-migration-guide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/appendices/0.37.0-migration-guide.md b/docs/appendices/0.37.0-migration-guide.md index bc7943389..cb33e72df 100644 --- a/docs/appendices/0.37.0-migration-guide.md +++ b/docs/appendices/0.37.0-migration-guide.md @@ -4,3 +4,4 @@ - Support for the `DOKKU_DOCKERFILE_CACHE_BUILD` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead. - Support for the `DOKKU_DOCKER_BUILD_OPTS` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead. +- Support for the `no-cache` nixpacks property has been removed. Use the `docker-options` plugin to set build arguments for your app instead. From f1763bdaf5082386dfd40271658ad2ea2271aa0b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:35:52 -0500 Subject: [PATCH 17/23] fix: correct lint issue --- plugins/builder-dockerfile/builder-build | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 56852547c..47da0781f 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -36,7 +36,6 @@ trigger-builder-dockerfile-builder-build() { DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" - DOCKER_ARGS=" $DOCKER_ARGS " eval set -- "$DOCKER_ARGS" From 3b35656ae9c55f27b1770dc739a54e7b7df809e4 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2025 00:26:53 -0500 Subject: [PATCH 18/23] fix: shift the unknown arguments out They should just be ignored. --- plugins/builder-dockerfile/builder-build | 1 + plugins/builder-nixpacks/builder-build | 1 + plugins/builder-pack/builder-build | 1 + plugins/builder-railpack/builder-build | 1 + 4 files changed, 4 insertions(+) diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 47da0781f..86294c02c 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -236,6 +236,7 @@ trigger-builder-dockerfile-builder-build() { shift 1 ;; *) + shift continue ;; esac diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index d7fa62820..beecc3a1a 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -158,6 +158,7 @@ trigger-builder-nixpacks-builder-build() { shift 1 ;; *) + shift continue ;; esac diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index e3d3eef84..50daad571 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -123,6 +123,7 @@ trigger-builder-pack-builder-build() { shift 1 ;; *) + shift continue ;; esac diff --git a/plugins/builder-railpack/builder-build b/plugins/builder-railpack/builder-build index afc5ff65f..133de71db 100755 --- a/plugins/builder-railpack/builder-build +++ b/plugins/builder-railpack/builder-build @@ -114,6 +114,7 @@ trigger-builder-railpack-builder-build() { shift 1 ;; *) + shift continue ;; esac From 9bda9e721fec7a2bebb42ed2cd7ebc5ad2b50ce3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2025 00:30:35 -0500 Subject: [PATCH 19/23] feat: add support for flags with = signs --- plugins/builder-nixpacks/builder-build | 78 ++++++++++++- plugins/builder-pack/builder-build | 153 ++++++++++++++++++++++++- 2 files changed, 226 insertions(+), 5 deletions(-) diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index beecc3a1a..7a5a5fc08 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -147,8 +147,82 @@ trigger-builder-nixpacks-builder-build() { fi shift 1 ;; - --platform | --cache-key | --incremental-cache-image | --libs | --cache-from | --docker-host | --add-host | --docker-tls-verify) - # todo: additionally support --flag=value syntax + --platform) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --platform=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --cache-key) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --cache-key=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --incremental-cache-image) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --incremental-cache-image=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --libs) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --libs=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --cache-from) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --cache-from=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --docker-host) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --docker-host=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --add-host) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --add-host=*) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --docker-tls-verify) + NIXPACKS_ARGS+=("$1") + NIXPACKS_ARGS+=("$2") + shift 2 + ;; + --docker-tls-verify=*) NIXPACKS_ARGS+=("$1") NIXPACKS_ARGS+=("$2") shift 2 diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 50daad571..338d8144b 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -112,12 +112,159 @@ trigger-builder-pack-builder-build() { fi shift 1 ;; - --cache | --cache-image | --creation-time | --env-file | --extension | --gid | --insecure-registry | --lifecycle-image | --network | --platform | --post-buildpack | --pre-buildpack | --previous-image | --pull-policy | --run-image | --uid | --workspace) - # todo: additionally support --flag=value syntax - PACK_ARGS+=("$1") + --cache) + PACK_ARGS+=("--cache") PACK_ARGS+=("$2") shift 2 ;; + --cache=*) + PACK_ARGS+=("--cache" "${1#--cache=}") + shift 1 + ;; + --cache-image) + PACK_ARGS+=("--cache-image") + PACK_ARGS+=("$2") + shift 2 + ;; + --cache-image=*) + PACK_ARGS+=("--cache-image" "${1#--cache-image=}") + shift 1 + ;; + --creation-time) + PACK_ARGS+=("--creation-time") + PACK_ARGS+=("$2") + shift 2 + ;; + --creation-time=*) + PACK_ARGS+=("--creation-time" "${1#--creation-time=}") + shift 1 + ;; + --env-file) + PACK_ARGS+=("--env-file") + PACK_ARGS+=("$2") + shift 2 + ;; + --env-file=*) + PACK_ARGS+=("--env-file" "${1#--env-file=}") + shift 1 + ;; + --extension) + PACK_ARGS+=("--extension") + PACK_ARGS+=("$2") + shift 2 + ;; + --extension=*) + PACK_ARGS+=("--extension" "${1#--extension=}") + shift 1 + ;; + --gid) + PACK_ARGS+=("--gid") + PACK_ARGS+=("$2") + shift 2 + ;; + --gid=*) + PACK_ARGS+=("--gid" "${1#--gid=}") + shift 1 + ;; + --insecure-registry) + PACK_ARGS+=("--insecure-registry") + PACK_ARGS+=("$2") + shift 2 + ;; + --insecure-registry=*) + PACK_ARGS+=("--insecure-registry" "${1#--insecure-registry=}") + shift 1 + ;; + --lifecycle-image) + PACK_ARGS+=("--lifecycle-image") + PACK_ARGS+=("$2") + shift 2 + ;; + --lifecycle-image=*) + PACK_ARGS+=("--lifecycle-image" "${1#--lifecycle-image=}") + shift 1 + ;; + --network) + PACK_ARGS+=("--network") + PACK_ARGS+=("$2") + shift 2 + ;; + --network=*) + PACK_ARGS+=("--network" "${1#--network=}") + shift 1 + ;; + --platform) + PACK_ARGS+=("--platform") + PACK_ARGS+=("$2") + shift 2 + ;; + --platform=*) + PACK_ARGS+=("--platform" "${1#--platform=}") + shift 1 + ;; + --post-buildpack) + PACK_ARGS+=("--post-buildpack") + PACK_ARGS+=("$2") + shift 2 + ;; + --post-buildpack=*) + PACK_ARGS+=("--post-buildpack" "${1#--post-buildpack=}") + shift 1 + ;; + --pre-buildpack) + PACK_ARGS+=("--pre-buildpack") + PACK_ARGS+=("$2") + shift 2 + ;; + --pre-buildpack=*) + PACK_ARGS+=("--pre-buildpack" "${1#--pre-buildpack=}") + shift 1 + ;; + --previous-image) + PACK_ARGS+=("--previous-image") + PACK_ARGS+=("$2") + shift 2 + ;; + --previous-image=*) + PACK_ARGS+=("--previous-image" "${1#--previous-image=}") + shift 1 + ;; + --pull-policy) + PACK_ARGS+=("--pull-policy") + PACK_ARGS+=("$2") + shift 2 + ;; + --pull-policy=*) + PACK_ARGS+=("--pull-policy" "${1#--pull-policy=}") + shift 1 + ;; + --run-image) + PACK_ARGS+=("--run-image") + PACK_ARGS+=("$2") + shift 2 + ;; + --run-image=*) + PACK_ARGS+=("--run-image" "${1#--run-image=}") + shift 1 + ;; + --uid) + PACK_ARGS+=("--uid") + PACK_ARGS+=("$2") + shift 2 + ;; + --uid=*) + PACK_ARGS+=("--uid" "${1#--uid=}") + shift 1 + ;; + --workspace) + PACK_ARGS+=("--workspace") + PACK_ARGS+=("$2") + shift 2 + ;; + --workspace=*) + PACK_ARGS+=("--workspace" "${1#--workspace=}") + shift 1 + ;; --clear-cache | --disable-system-buildpacks | --publish | --trust-builder | --trust-extra-buildpacks | --userns-host) PACK_ARGS+=("$1") shift 1 From 406a82de29ecd5994a351ccdf82912970ec1bf4d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2025 01:10:15 -0500 Subject: [PATCH 20/23] fix: use call instead of env --- plugins/builder-dockerfile/builder-build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 86294c02c..68c7e8399 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -115,12 +115,12 @@ trigger-builder-dockerfile-builder-build() { shift 1 ;; --call) - DOCKERFILE_ARGS+=("--env") + DOCKERFILE_ARGS+=("--call") DOCKERFILE_ARGS+=("$2") shift 2 ;; - --env=*) - DOCKERFILE_ARGS+=("--env" "${1#--env=}") + --call=*) + DOCKERFILE_ARGS+=("--call" "${1#--call=}") shift 1 ;; --cgroup-parent) From 9411c4ddc1f1b785ac8e930bf7579d3292cd55f5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2025 01:10:53 -0500 Subject: [PATCH 21/23] test: ensure the deploy succeeds and then check the output vs using grep --- tests/unit/config.bats | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit/config.bats b/tests/unit/config.bats index 1825feb12..e9bfb1fce 100644 --- a/tests/unit/config.bats +++ b/tests/unit/config.bats @@ -486,10 +486,15 @@ teardown() { @test "(config) global config (dockerfile)" { run deploy_app dockerfile - run /bin/bash -c "dokku run $TEST_APP env | grep -E '^global_test=true'" echo "output: $output" echo "status: $status" assert_success + + run /bin/bash -c "dokku run $TEST_APP env" + echo "output: $output" + echo "status: $status" + assert_success + assert_output_contains "global_test=true" } @test "(config) config:show" { From 531bb205192661c3c8c17ed154222adf11e8827f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2025 01:11:09 -0500 Subject: [PATCH 22/23] tests: respect the globally specified default branch when running tests --- tests/test_deploy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_deploy b/tests/test_deploy index 01ecbda18..651e16098 100755 --- a/tests/test_deploy +++ b/tests/test_deploy @@ -45,10 +45,11 @@ git add . [[ -x pre-commit ]] && ./pre-commit "$REMOTE" "$REPO" git commit -m 'initial commit' +current_branch="$(git rev-parse --abbrev-ref HEAD)" if [[ "$SHOULD_FAIL" == true ]]; then - git push target "master:$BRANCH" && succeeded git-push + git push target "$current_branch:$BRANCH" && succeeded git-push else - git push target "master:$BRANCH" || failed git-push + git push target "$current_branch:$BRANCH" || failed git-push fi if [[ -x post-deploy ]]; then ./post-deploy "$REMOTE" "$REPO" || failed post-deploy From a9127e3abd5929206e134566567eb74b3482e247 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2025 01:24:28 -0500 Subject: [PATCH 23/23] fix: correctly handle exiting the argument parsing loop --- plugins/builder-dockerfile/builder-build | 7 +++++-- plugins/builder-nixpacks/builder-build | 7 +++++-- plugins/builder-pack/builder-build | 7 +++++-- plugins/builder-railpack/builder-build | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/plugins/builder-dockerfile/builder-build b/plugins/builder-dockerfile/builder-build index 68c7e8399..f8c8c46fa 100755 --- a/plugins/builder-dockerfile/builder-build +++ b/plugins/builder-dockerfile/builder-build @@ -236,8 +236,11 @@ trigger-builder-dockerfile-builder-build() { shift 1 ;; *) - shift - continue + if [[ -n "$1" ]]; then + shift + continue + fi + break ;; esac done diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index 7a5a5fc08..d74d9ba3a 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -232,8 +232,11 @@ trigger-builder-nixpacks-builder-build() { shift 1 ;; *) - shift - continue + if [[ -n "$1" ]]; then + shift + continue + fi + break ;; esac done diff --git a/plugins/builder-pack/builder-build b/plugins/builder-pack/builder-build index 338d8144b..305d21514 100755 --- a/plugins/builder-pack/builder-build +++ b/plugins/builder-pack/builder-build @@ -270,8 +270,11 @@ trigger-builder-pack-builder-build() { shift 1 ;; *) - shift - continue + if [[ -n "$1" ]]; then + shift + continue + fi + break ;; esac done diff --git a/plugins/builder-railpack/builder-build b/plugins/builder-railpack/builder-build index 133de71db..3b7e7e6df 100755 --- a/plugins/builder-railpack/builder-build +++ b/plugins/builder-railpack/builder-build @@ -114,8 +114,11 @@ trigger-builder-railpack-builder-build() { shift 1 ;; *) - shift - continue + if [[ -n "$1" ]]; then + shift + continue + fi + break ;; esac done