From 68bd57b61953195a0a6fede99c4a830d110a7f45 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Tue, 6 Oct 2026 08:50:02 +0100 Subject: [PATCH] Update Go tooling and fix path Signed-off-by: Marcus Noble --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 85fc6e6..c525160 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,17 @@ FROM debian:bookworm-slim AS base ENV DEBIAN_FRONTEND=noninteractive ENV LANG=C.UTF-8 ENV LC_ALL=C.UTF-8 +ARG TARGETARCH=amd64 # ─── Common CLI tools ─────────────────────────────────────────── RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + gcc \ git \ jq \ less \ + make \ openssh-client \ procps \ sudo \ @@ -39,7 +42,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ # ─── Go 1.26 ──────────────────────────────────────────────────── ARG GO_VERSION=1.26.8 -ARG TARGETARCH=amd64 +ARG GOLANG_LINT_VERSION=v2.14.0 RUN case "$TARGETARCH" in \ amd64|arm64) GOOS="linux"; GOARCH="$TARGETARCH" ;; \ *) GOOS="linux"; GOARCH="amd64" ;; \ @@ -50,6 +53,9 @@ RUN case "$TARGETARCH" in \ rm /tmp/go.tar.gz ENV PATH="/usr/local/go/bin:/root/go/bin:/usr/local/bin:${PATH}" RUN go version +RUN go install golang.org/x/tools/cmd/goimports@latest && \ + go install honnef.co/go/tools/cmd/staticcheck@latest && \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/${GOLANG_LINT_VERSION}/install.sh | sh -s -- -b /root/go/bin ${GOLANG_LINT_VERSION} # ─── Docker CLI ────────────────────────────────────────────────── ARG DOCKER_CLI_VERSION=29.8.1 @@ -69,3 +75,6 @@ RUN case "$TARGETARCH" in \ RUN rm -rf /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* + +# ─── Persist Go on PATH after /etc/profile resets it ──────────── +RUN printf 'export PATH="/usr/local/go/bin:/root/go/bin:/usr/local/bin:$PATH"\n' > /etc/profile.d/go.sh