Update Go tooling and fix path
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
1 file changed
+10
-1
+10
-1
@@ -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
|
||||
Reference in new issue
Block a user