mirror of
https://github.com/dockersrc/go
synced 2026-06-24 14:01:08 -04:00
4a5c802368
Replace the service-lifecycle init script with a lean Go-native default workflow. Running the container with no arguments now automatically formats, vets, tests, and builds the mounted project. - rootfs/usr/local/etc/docker/init.d/00-go.sh: stripped from 979 lines of daemon-lifecycle boilerplate to 3 lines that export CONTAINER_INIT=yes and SERVICE_USES_PID=no, telling the init framework this is a configuration-only container (no daemon, no keep-alive loop) - rootfs/usr/local/bin/go-workflow: new script — runs the canonical Go workflow in order: go mod tidy → gofmt -w . → go vet ./... → go test ./... → go build ./...; exits 1 with a clear usage message if no go.mod is found in /app - rootfs/usr/local/bin/entrypoint.sh: no-args path in both the init block and the * case now exec go-workflow instead of __no_exit; verified: default workflow, explicit commands, sh -c passthrough, and missing go.mod error all behave correctly - README.md: document the default workflow prominently; update one-shot examples; add golangci-lint --timeout note; add tail null long-running pattern README.md rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/bin/go-workflow rootfs/usr/local/etc/docker/init.d/00-go.sh
18 lines
801 B
Bash
Executable File
18 lines
801 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
##@Version : 202605292219-git
|
|
# @@Author : Jason Hempstead
|
|
# @@Contact : jason@casjaysdev.pro
|
|
# @@License : WTFPL
|
|
# @@ReadME : 00-go.sh --help
|
|
# @@Copyright : Copyright: (c) 2026 Jason Hempstead, Casjays Developments
|
|
# @@Created : Friday, May 29, 2026 22:22 EDT
|
|
# @@File : 00-go.sh
|
|
# @@Description : Go toolchain — configuration-only init (no daemon)
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
# Tell the init framework this is a configuration service, not a daemon.
|
|
# This prevents __start_init_scripts from waiting for a PID or keep-alive loop.
|
|
export CONTAINER_INIT="yes"
|
|
export SERVICE_USES_PID="no"
|