mirror of
https://github.com/dockersrc/go
synced 2026-06-24 20:01:07 -04:00
🔧 Update scripts and add CA cert update 🔧
Update all container scripts to 202605241245-git and add CA certificate update step after package installation. - rootfs/root/docker/setup/00-init.sh: updated to latest template - rootfs/root/docker/setup/01-system.sh: updated to latest template - rootfs/root/docker/setup/02-packages.sh: add update-ca-certificates/update-ca-trust step - rootfs/root/docker/setup/03-files.sh: updated to latest template - rootfs/root/docker/setup/04-users.sh: updated to latest template - rootfs/root/docker/setup/05-custom.sh: updated to latest template - rootfs/root/docker/setup/06-post.sh: updated to latest template - rootfs/root/docker/setup/07-cleanup.sh: updated to latest template - rootfs/usr/local/bin/entrypoint.sh: updated to 202605241245-git - rootfs/usr/local/bin/pkmgr: updated to 202605241245-git - rootfs/usr/local/etc/docker/functions/entrypoint.sh: updated to 202605241245-git rootfs/root/docker/setup/00-init.sh rootfs/root/docker/setup/01-system.sh rootfs/root/docker/setup/02-packages.sh rootfs/root/docker/setup/03-files.sh rootfs/root/docker/setup/04-users.sh rootfs/root/docker/setup/05-custom.sh rootfs/root/docker/setup/06-post.sh rootfs/root/docker/setup/07-cleanup.sh rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/bin/pkmgr rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:55 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:09 PM EDT 2026
|
||||
# @@File : 00-init.sh
|
||||
# @@Description : script to run init
|
||||
# @@Changelog : newScript
|
||||
@@ -36,9 +36,10 @@ if [ -d "/usr/local/share/template-files/defaults" ]; then rm -Rf "/usr/local/sh
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:56 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:09 PM EDT 2026
|
||||
# @@File : 01-system.sh
|
||||
# @@Description : script to run system
|
||||
# @@Changelog : newScript
|
||||
@@ -34,9 +34,10 @@ exitCode=0
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242139-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:56 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:10 PM EDT 2026
|
||||
# @@File : 02-packages.sh
|
||||
# @@Description : script to run packages
|
||||
# @@Changelog : newScript
|
||||
@@ -31,87 +31,20 @@ exitCode=0
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Main script
|
||||
|
||||
# Install the latest upstream Go toolchain straight from go.dev.
|
||||
# We don't use apk's `go` package because Alpine often lags upstream by
|
||||
# a release. Tarballs from go.dev are HTTPS-served and we additionally
|
||||
# verify the SHA256 published in the same JSON catalog.
|
||||
#
|
||||
# Wrapped in a subshell with `set -e` so any single step (curl, jq,
|
||||
# sha256sum, tar) that fails aborts the whole installer and the
|
||||
# parent script returns non-zero - the Dockerfile then fails the build
|
||||
# rather than silently producing a broken image.
|
||||
(
|
||||
set -euo pipefail
|
||||
|
||||
case "$(uname -m)" in
|
||||
x86_64) GO_ARCH="amd64" ;;
|
||||
aarch64) GO_ARCH="arm64" ;;
|
||||
armv7l|armv6l) GO_ARCH="armv6l" ;;
|
||||
i386|i686) GO_ARCH="386" ;;
|
||||
ppc64le) GO_ARCH="ppc64le" ;;
|
||||
s390x) GO_ARCH="s390x" ;;
|
||||
riscv64) GO_ARCH="riscv64" ;;
|
||||
*)
|
||||
echo "Unsupported architecture for upstream Go install: $(uname -m)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
GO_DL_INDEX="https://go.dev/dl/?mode=json"
|
||||
GO_INDEX_JSON="$(curl -fsSL "$GO_DL_INDEX")"
|
||||
# `// empty` makes jq emit nothing (instead of the literal string
|
||||
# "null") when the path is missing, so the [ -z ... ] check below
|
||||
# actually catches resolution failures.
|
||||
GO_VERSION="$(printf '%s' "$GO_INDEX_JSON" \
|
||||
| jq -r '[.[] | select(.stable == true)][0].version // empty')"
|
||||
if [ -z "$GO_VERSION" ]; then
|
||||
echo "Failed to resolve latest Go version from $GO_DL_INDEX" >&2
|
||||
exit 1
|
||||
fi
|
||||
GO_FILE="${GO_VERSION}.linux-${GO_ARCH}.tar.gz"
|
||||
GO_SHA256="$(printf '%s' "$GO_INDEX_JSON" \
|
||||
| jq -r --arg f "$GO_FILE" '[.[] | select(.stable == true)][0].files[] | select(.filename == $f) | .sha256 // empty')"
|
||||
if [ -z "$GO_SHA256" ]; then
|
||||
echo "Failed to resolve sha256 for $GO_FILE from $GO_DL_INDEX" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing upstream ${GO_VERSION} for linux/${GO_ARCH}"
|
||||
curl -fsSL "https://go.dev/dl/${GO_FILE}" -o "/tmp/${GO_FILE}"
|
||||
echo "${GO_SHA256} /tmp/${GO_FILE}" | sha256sum -c -
|
||||
|
||||
rm -rf /usr/local/go
|
||||
tar -C /usr/local -xzf "/tmp/${GO_FILE}"
|
||||
rm -f "/tmp/${GO_FILE}"
|
||||
|
||||
# Expose go + gofmt on PATH (the rest of the Go-shipped tools are
|
||||
# invoked through `go tool ...` and don't need symlinks).
|
||||
ln -sf /usr/local/go/bin/go /usr/local/bin/go
|
||||
ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
||||
|
||||
# Sanity-check the install before subsequent setup steps depend on it.
|
||||
/usr/local/bin/go version
|
||||
|
||||
# Trim ~70MB of test data and API definitions that aren't useful at
|
||||
# build/run time. Stdlib sources stay (needed for `go build`).
|
||||
rm -rf /usr/local/go/test /usr/local/go/api /usr/local/go/doc
|
||||
)
|
||||
__go_install_rc=$?
|
||||
# Note: this is intentionally a separate statement, not `(...) || exit`.
|
||||
# Bash silently disables `set -e` inside an explicit subshell when the
|
||||
# subshell appears on the left of && or ||, so the form below is the
|
||||
# only reliable way to propagate set -e failures from the subshell.
|
||||
if [ "$__go_install_rc" -ne 0 ]; then
|
||||
exit "$__go_install_rc"
|
||||
if command -v update-ca-certificates >/dev/null 2>&1; then
|
||||
update-ca-certificates
|
||||
elif command -v update-ca-trust >/dev/null 2>&1; then
|
||||
update-ca-trust extract
|
||||
elif command -v trust >/dev/null 2>&1; then
|
||||
trust extract-compat
|
||||
fi
|
||||
unset __go_install_rc
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:57 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:10 PM EDT 2026
|
||||
# @@File : 03-files.sh
|
||||
# @@Description : script to run files
|
||||
# @@Changelog : newScript
|
||||
@@ -31,51 +31,55 @@ exitCode=0
|
||||
if [ -d "/tmp/bin" ]; then
|
||||
mkdir -p "/usr/local/bin"
|
||||
for bin in "/tmp/bin"/*; do
|
||||
name="$(basename -- "$bin")"
|
||||
[ -e "$bin" ] || continue
|
||||
name="${bin##*/}"
|
||||
echo "Installing $name to /usr/local/bin/$name"
|
||||
copy "$bin" "/usr/local/bin/$name"
|
||||
cp -Rf "$bin" "/usr/local/bin/$name"
|
||||
chmod -f +x "/usr/local/bin/$name"
|
||||
done
|
||||
fi
|
||||
unset bin
|
||||
if [ -d "/tmp/var" ]; then
|
||||
for var in "/tmp/var"/*; do
|
||||
name="$(basename -- "$var")"
|
||||
[ -e "$var" ] || continue
|
||||
name="${var##*/}"
|
||||
echo "Installing $var to /var/$name"
|
||||
if [ -d "$var" ]; then
|
||||
mkdir -p "/var/$name"
|
||||
copy "$var/." "/var/$name/"
|
||||
cp -Rf "$var/." "/var/$name/"
|
||||
else
|
||||
copy "$var" "/var/$name"
|
||||
cp -Rf "$var" "/var/$name"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
unset var
|
||||
if [ -d "/tmp/etc" ]; then
|
||||
for config in "/tmp/etc"/*; do
|
||||
name="$(basename -- "$config")"
|
||||
[ -e "$config" ] || continue
|
||||
name="${config##*/}"
|
||||
echo "Installing $config to /etc/$name"
|
||||
if [ -d "$config" ]; then
|
||||
mkdir -p "/etc/$name"
|
||||
copy "$config/." "/etc/$name/"
|
||||
cp -Rf "$config/." "/etc/$name/"
|
||||
mkdir -p "/usr/local/share/template-files/config/$name"
|
||||
copy "$config/." "/usr/local/share/template-files/config/$name/"
|
||||
cp -Rf "$config/." "/usr/local/share/template-files/config/$name/"
|
||||
else
|
||||
copy "$config" "/etc/$name"
|
||||
copy "$config" "/usr/local/share/template-files/config/$name"
|
||||
cp -Rf "$config" "/etc/$name"
|
||||
cp -Rf "$config" "/usr/local/share/template-files/config/$name"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
unset config
|
||||
if [ -d "/tmp/data" ]; then
|
||||
for data in "/tmp/data"/*; do
|
||||
name="$(basename -- "$data")"
|
||||
[ -e "$data" ] || continue
|
||||
name="${data##*/}"
|
||||
echo "Installing $data to /usr/local/share/template-files/data"
|
||||
if [ -d "$data" ]; then
|
||||
mkdir -p "/usr/local/share/template-files/data/$name"
|
||||
copy "$data/." "/usr/local/share/template-files/data/$name/"
|
||||
cp -Rf "$data/." "/usr/local/share/template-files/data/$name/"
|
||||
else
|
||||
copy "$data" "/usr/local/share/template-files/data/$name"
|
||||
cp -Rf "$data" "/usr/local/share/template-files/data/$name"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -83,35 +87,12 @@ unset data
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Main script
|
||||
|
||||
# Create conventional Go project dirs. Users can mount their code into
|
||||
# any of these; WORKDIR defaults to /app.
|
||||
for dir in /app /work /root/app /root/project; do
|
||||
mkdir -p "$dir"
|
||||
chmod 0755 "$dir"
|
||||
done
|
||||
|
||||
# Canonical Go state dir (FHS-style: arch-independent shared data);
|
||||
# declared as a Docker VOLUME for cross-rebuild persistence. The paths
|
||||
# /go, /root/go, /root/.go, /root/.local/share/go are symlinks to this
|
||||
# location so any of the conventional GOPATH paths resolve here. /data/go
|
||||
# is symlinked at runtime by the init script (since /data is a volume).
|
||||
GO_STATE_DIR="/usr/local/share/go"
|
||||
mkdir -p "${GO_STATE_DIR}/bin" "${GO_STATE_DIR}/cache" "${GO_STATE_DIR}/pkg/mod"
|
||||
chmod -R 0755 "${GO_STATE_DIR}"
|
||||
mkdir -p /root/.local/share
|
||||
for link in /go /root/go /root/.go /root/.local/share/go; do
|
||||
if [ -e "$link" ] && [ ! -L "$link" ]; then
|
||||
rm -rf "$link"
|
||||
fi
|
||||
ln -sfn "${GO_STATE_DIR}" "$link"
|
||||
done
|
||||
unset GO_STATE_DIR link
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:57 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:10 PM EDT 2026
|
||||
# @@File : 04-users.sh
|
||||
# @@Description : script to run users
|
||||
# @@Changelog : newScript
|
||||
@@ -34,9 +34,10 @@ exitCode=0
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:57 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:10 PM EDT 2026
|
||||
# @@File : 05-custom.sh
|
||||
# @@Description : script to run custom
|
||||
# @@Changelog : newScript
|
||||
@@ -32,123 +32,12 @@ exitCode=0
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Main script
|
||||
|
||||
# Install Go developer tools into /usr/local/bin so they are on PATH
|
||||
# without pulling GOPATH/bin into the runtime image. CGO disabled so the
|
||||
# tools themselves are fully static (matches the image default).
|
||||
export GOPATH="${GOPATH:-/usr/local/share/go}"
|
||||
export GOBIN="/usr/local/bin"
|
||||
export PATH="${GOBIN}:${PATH}"
|
||||
export CGO_ENABLED=0
|
||||
export GOTOOLCHAIN=auto
|
||||
export GOMAXPROCS="${GOMAXPROCS:-2}"
|
||||
export GOMEMLIMIT="${GOMEMLIMIT:-1GiB}"
|
||||
export GOFLAGS="${GOFLAGS:+${GOFLAGS} }-p=1"
|
||||
mkdir -p "$GOPATH" "$GOPATH/bin" "$GOPATH/cache" "$GOPATH/pkg/mod"
|
||||
|
||||
if command -v go >/dev/null 2>&1; then
|
||||
echo "Installing Go developer tools with $(go version)"
|
||||
tool_install_count=0
|
||||
|
||||
install_go_tool() {
|
||||
local tool="$1"
|
||||
|
||||
echo "go install $tool"
|
||||
# Best-effort: don't fail the build if a single upstream tool has
|
||||
# stale deps incompatible with the current Go release. The rest of
|
||||
# the kitchen-sink installs cleanly and the user can manually
|
||||
# `go install` whichever tools they need at runtime against their
|
||||
# own version pin.
|
||||
go install "$tool" || echo " WARN: skipping $tool (install failed)" >&2
|
||||
|
||||
tool_install_count=$((tool_install_count + 1))
|
||||
if [ "$tool_install_count" -ge 5 ]; then
|
||||
go clean -cache -testcache 2>/dev/null || true
|
||||
tool_install_count=0
|
||||
fi
|
||||
}
|
||||
|
||||
for tool in \
|
||||
"github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest" \
|
||||
"golang.org/x/tools/gopls@latest" \
|
||||
"golang.org/x/tools/cmd/goimports@latest" \
|
||||
"golang.org/x/tools/cmd/stringer@latest" \
|
||||
"golang.org/x/tools/cmd/godoc@latest" \
|
||||
"golang.org/x/tools/cmd/deadcode@latest" \
|
||||
"golang.org/x/tools/cmd/callgraph@latest" \
|
||||
"golang.org/x/tools/cmd/guru@latest" \
|
||||
"golang.org/x/tools/cmd/gorename@latest" \
|
||||
"golang.org/x/lint/golint@latest" \
|
||||
"golang.org/x/perf/cmd/benchstat@latest" \
|
||||
"github.com/go-delve/delve/cmd/dlv@latest" \
|
||||
"mvdan.cc/gofumpt@latest" \
|
||||
"honnef.co/go/tools/cmd/staticcheck@latest" \
|
||||
"golang.org/x/vuln/cmd/govulncheck@latest" \
|
||||
"github.com/air-verse/air@latest" \
|
||||
"go.uber.org/mock/mockgen@latest" \
|
||||
"github.com/swaggo/swag/cmd/swag@latest" \
|
||||
"google.golang.org/protobuf/cmd/protoc-gen-go@latest" \
|
||||
"google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest" \
|
||||
"github.com/kisielk/errcheck@latest" \
|
||||
"github.com/gordonklaus/ineffassign@latest" \
|
||||
"github.com/fzipp/gocyclo/cmd/gocyclo@latest" \
|
||||
"github.com/securego/gosec/v2/cmd/gosec@latest" \
|
||||
"github.com/cweill/gotests/gotests@latest" \
|
||||
"github.com/josharian/impl@latest" \
|
||||
"github.com/fatih/gomodifytags@latest" \
|
||||
"gotest.tools/gotestsum@latest" \
|
||||
"github.com/kyoh86/richgo@latest" \
|
||||
"github.com/goreleaser/goreleaser/v2@latest" \
|
||||
"github.com/vektra/mockery/v2@latest" \
|
||||
"github.com/google/wire/cmd/wire@latest" \
|
||||
"github.com/sqlc-dev/sqlc/cmd/sqlc@latest" \
|
||||
"github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest" \
|
||||
"github.com/bufbuild/buf/cmd/buf@latest" \
|
||||
"github.com/go-task/task/v3/cmd/task@latest" \
|
||||
"github.com/google/ko@latest" \
|
||||
"github.com/magefile/mage@latest" \
|
||||
"github.com/pressly/goose/v3/cmd/goose@latest" \
|
||||
"github.com/mgechev/revive@latest" \
|
||||
"github.com/daixiang0/gci@latest" \
|
||||
"github.com/segmentio/golines@latest" \
|
||||
"go.uber.org/nilaway/cmd/nilaway@latest" \
|
||||
"github.com/jstemmer/go-junit-report/v2@latest" \
|
||||
"github.com/boumenot/gocover-cobertura@latest" \
|
||||
"github.com/jandelgado/gcov2lcov@latest" \
|
||||
"github.com/google/gops@latest" \
|
||||
"github.com/dmarkham/enumer@latest" \
|
||||
"github.com/mailru/easyjson/easyjson@latest" \
|
||||
"github.com/envoyproxy/protoc-gen-validate@latest" \
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest" \
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest" \
|
||||
; do
|
||||
install_go_tool "$tool"
|
||||
done
|
||||
|
||||
# migrate: needs build tags for DB driver compilation. Limited to
|
||||
# the common pure-Go drivers (postgres, pgx, mysql, sqlite) - the
|
||||
# full driver set (cockroachdb, spanner, clickhouse, mongodb,
|
||||
# redshift) pulls in ~2GB of transitive deps and has been observed
|
||||
# to crash bash mid-compile inside resource-constrained build
|
||||
# environments. Users who need those drivers can rebuild migrate at
|
||||
# runtime with whatever tags they need.
|
||||
echo "go install golang-migrate/migrate (pure-Go drivers)"
|
||||
go install -tags 'postgres,pgx,mysql,sqlite' \
|
||||
github.com/golang-migrate/migrate/v4/cmd/migrate@latest \
|
||||
|| echo " WARN: skipping migrate (install failed)" >&2
|
||||
|
||||
# Drop the module cache; it's not needed in the final image.
|
||||
go clean -testcache 2>/dev/null || true
|
||||
go clean -modcache 2>/dev/null || true
|
||||
go clean -cache 2>/dev/null || true
|
||||
rm -rf "$GOPATH/pkg" "$GOPATH/src" 2>/dev/null || true
|
||||
else
|
||||
echo "go binary not found; skipping Go dev tools" >&2
|
||||
fi
|
||||
|
||||
# Always succeed: tool installation is best-effort, the build environment
|
||||
# is functional even if some optional dev tools didn't make it. The Go
|
||||
# toolchain itself was already verified by 02-packages.sh.
|
||||
exit 0
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:58 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:10 PM EDT 2026
|
||||
# @@File : 06-post.sh
|
||||
# @@Description : script to run post
|
||||
# @@Changelog : newScript
|
||||
@@ -34,9 +34,10 @@ exitCode=0
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202604221922-git
|
||||
##@Version : 202605242059-git
|
||||
# @@Author : CasjaysDev
|
||||
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
||||
# @@License : MIT
|
||||
# @@Copyright : Copyright 2026 CasjaysDev
|
||||
# @@Created : Wed Apr 22 07:22:58 PM EDT 2026
|
||||
# @@Created : Sun May 24 08:59:10 PM EDT 2026
|
||||
# @@File : 07-cleanup.sh
|
||||
# @@Description : script to run cleanup
|
||||
# @@Changelog : newScript
|
||||
@@ -24,7 +24,7 @@ set -o pipefail
|
||||
[ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -x$DEBUGGER_OPTIONS
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Load functions
|
||||
__find_and_remove() { [ -z "$1" ] || find "${2:-/etc}" -iname "$1" -exec rm -Rf {} \; 2>/dev/null; }
|
||||
__find_and_remove() { [ -z "$1" ] || find "${2:-/etc}" -iname "$1" -exec rm -Rf {} + 2>/dev/null; }
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set env variables
|
||||
exitCode=0
|
||||
@@ -38,9 +38,10 @@ if [ -d "$HOME/.cache" ]; then rm -Rf "$HOME/.cache"; fi
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set the exit code
|
||||
#exitCode=$?
|
||||
exitCode=$?
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $exitCode
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
Reference in New Issue
Block a user