mirror of
https://github.com/dockersrc/go
synced 2026-06-24 14:01:08 -04:00
8dc2fd894b
set -e in go-workflow made the retVal/GO_EXITCODE accumulator dead code —
any failing run_step call exits the script immediately via set -e before
retVal=$? is ever reached, so GO_EXITCODE only ever sums zeros.
Remove the accumulator and simplify run_step; set -e already propagates
failures naturally.
__exec_command in the *) and exec) cases only used the first element of its
arg array (local cmdExec="${arg:-}" expands to arg[0]), silently dropping
every subsequent word. "docker run casjaysdev/go go test ./..." ran just
"go" with no subcommand. Replace __exec_command with exec "$@" directly in
both cases; exec is correct (no extra process) and preserves all args.
00-go.sh exported CONTAINER_INIT and SERVICE_USES_PID inside a subshell
( source "$init" ) — those exports never propagated back to the parent
entrypoint. Move SERVICE_USES_PID="no" to go.sh (sourced by the parent
shell before __start_init_scripts runs) so the framework takes the explicit
"config service, no PID" path. Rewrite 00-go.sh as a documented placeholder
explaining why the file must still exist (init_count == 0 triggers an
infinite background keep-alive loop).
- rootfs/usr/local/bin/go-workflow: remove GO_EXITCODE/retVal accumulator;
simplify run_step to drop exitCode capture (always 0 with set -e)
- rootfs/usr/local/bin/entrypoint.sh: *) case uses exec "$@" / exec go-workflow;
exec) case uses exec "$@" with proper empty-arg error instead of broken
__exec_command fallback
- rootfs/usr/local/etc/docker/env/go.sh: add SERVICE_USES_PID="no"
- rootfs/usr/local/etc/docker/init.d/00-go.sh: remove dead exports; add
comment explaining placeholder purpose
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/bin/go-workflow
rootfs/usr/local/etc/docker/env/go.sh
rootfs/usr/local/etc/docker/init.d/00-go.sh
17 lines
662 B
Bash
17 lines
662 B
Bash
# Go toolchain image — pre-set service-discovery vars to skip __find_* subprocess forks
|
|
# The entrypoint sources this before the ${VAR:-$(function)} expansions, so each
|
|
# non-empty assignment here silently short-circuits the matching find call.
|
|
PHP_INI_DIR="none"
|
|
PHP_BIN_DIR="none"
|
|
HTTPD_CONFIG_FILE="none"
|
|
NGINX_CONFIG_FILE="none"
|
|
MYSQL_CONFIG_FILE="none"
|
|
PGSQL_CONFIG_FILE="none"
|
|
MONGODB_CONFIG_FILE="none"
|
|
|
|
# This image has no long-running daemon; suppress the startup banner and health loop
|
|
ENTRYPOINT_MESSAGE="no"
|
|
HEALTH_ENABLED="no"
|
|
# Tell __start_init_scripts this is a config-only init — no daemon process or PID file expected
|
|
SERVICE_USES_PID="no"
|