🐛 Fix __exec_command dropping all arguments after the first 🐛
Build and Push / build (push) Has been cancelled

__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
This commit is contained in:
2026-06-29 00:47:23 -04:00
parent af3dc66e9c
commit ef30df95de
@@ -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