mirror of
https://github.com/dockersrc/go
synced 2026-06-24 20:01:07 -04:00
🐛 Fix entrypoint arg passthrough — commands no longer hang 🐛
Root cause: entrypoint.sh unconditionally called `__no_exit` (an `exec bash -c` monitoring loop) even when the user passed a command to `docker run`, replacing the shell before the command could execute. Secondary bug in `__exec_command`: used `bash --login -c "$cmdExec"` which only captured the first word of the command and spawned a slow login shell on every invocation. - rootfs/usr/local/bin/entrypoint.sh: only call `__no_exit` when no user command was given (`$# -eq 0`); otherwise fall through to the case dispatch so `docker run ... go version` works correctly - rootfs/usr/local/etc/docker/functions/entrypoint.sh: rewrite `__exec_command` to use `exec "$@"` directly instead of wrapping in `bash --login -c "$cmdExec"`; both files kept in sync rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
@@ -506,9 +506,11 @@ if [ "$START_SERVICES" = "yes" ] || [ -z "$1" ]; then
|
||||
echo "$$" >"$ENTRYPOINT_PID_FILE"
|
||||
__start_init_scripts "/usr/local/etc/docker/init.d"
|
||||
CONTAINER_INIT="${CONTAINER_INIT:-no}"
|
||||
# Services started successfully - enter monitoring mode
|
||||
__no_exit
|
||||
exit $?
|
||||
# Only block in monitoring mode when no user command was given
|
||||
if [ $# -eq 0 ]; then
|
||||
__no_exit
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
START_SERVICES="no"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user