From affa6b11bb16a810948c0ca08e357e7e591dc74b Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 29 Jun 2026 00:46:54 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20=5F=5Fexec=5Fcommand=20dro?= =?UTF-8?q?pping=20all=20arguments=20after=20the=20first=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __exec_command was using ${arg:-} which only captured the first element of the args array, then ran it through "$shell" $pre_exec "$cmdExec" which effectively discarded everything after $1. Running `docker run image sh -c 'go build ...'` would: 1. Set arg=("sh" "-c" "go build ...") 2. Set cmdExec="sh" (only first element) 3. Run bash --login -c "sh" (dropping -c and the actual command) This broke any Makefile GO_DOCKER pattern that relied on passing multi-arg commands. Simplified to just `exec "$@"` which passes all args through. - rootfs/usr/local/etc/docker/functions/entrypoint.sh: rewrite __exec_command rootfs/usr/local/etc/docker/functions/entrypoint.sh --- .../local/etc/docker/functions/entrypoint.sh | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index 44265c9..c917d98 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -968,26 +968,11 @@ __create_env_file() { } # - - - - - - - - - - - - - - - - - - - - - - - - - __exec_command() { - local arg=("$@") local exitCode=0 - local cmdExec="${arg:-}" - local pre_exec="--login -c" - local shell bin prog - shell=$(type -P bash || type -P dash || type -P ash || type -P sh) 2>/dev/null - bin="${arg[0]:-bash}" - prog="$(type -P "$bin" 2>/dev/null || echo "$bin")" - if type -t "$bin" &>/dev/null; then - echo "${exec_message:-Executing command: $cmdExec}" - "$shell" $pre_exec "$cmdExec" - exitCode=$? - elif [ -f "$prog" ]; then - echo "$prog is not executable" - exitCode=98 - else - echo "$prog does not exist" - exitCode=99 + if [ $# -eq 0 ]; then + exec bash -l fi - return $exitCode + exec "$@" } # - - - - - - - - - - - - - - - - - - - - - - - - - # Setup the server init scripts