Files
base/node-go/Dockerfile
T
thuanleandClaude ae32c66e82
node-go image / build (arm64) (push) Successful in 14s
node-go image / build (amd64) (push) Failing after 0s
node-go image / amend-manifest (push) Skipped
fix(node-go): install golangci-lint directly, bypass install.sh checksum bug
The official install.sh (master branch) fails checksum verification because it
matches the .tar.gz line against the .sbom.json checksum (the tarball filename
is a prefix of the sbom filename). The downloaded tarball is NOT corrupt - its
real sha256 matches the checksums file - install.sh just picks the wrong line.

Replace install.sh with a direct tarball download + extract, reusing the
existing go_arch variable. Consistent with how Go itself is installed in this
Dockerfile (no checksum verification either).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 15:29:22 +07:00

36 lines
1.4 KiB
Docker

FROM node:lts-slim
ARG GO_VERSION=1.26
ARG GOLANGCI_LINT_VERSION=v2.12.2
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/usr/local/go/bin:${PATH}
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates curl git gcc libc6-dev; \
arch="$(dpkg --print-architecture)"; \
case "${arch}" in \
amd64) go_arch='linux-amd64' ;; \
arm64) go_arch='linux-arm64' ;; \
*) echo "Unsupported architecture: ${arch}" >&2; exit 1 ;; \
esac; \
case "${GO_VERSION}" in \
*.*.*) download_go_version="${GO_VERSION}" ;; \
*.*) download_go_version="${GO_VERSION}.0" ;; \
*) echo "GO_VERSION must be major.minor or major.minor.patch: ${GO_VERSION}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://go.dev/dl/go${download_go_version}.${go_arch}.tar.gz" -o /tmp/go.tgz; \
rm -rf /usr/local/go; \
tar -C /usr/local -xzf /tmp/go.tgz; \
rm -f /tmp/go.tgz; \
gcl_ver="${GOLANGCI_LINT_VERSION#v}"; \
curl -fsSL -o /tmp/gcl.tgz \
"https://github.com/golangci/golangci-lint/releases/download/${GOLANGCI_LINT_VERSION}/golangci-lint-${gcl_ver}-${go_arch}.tar.gz"; \
tar -C /tmp -xzf /tmp/gcl.tgz; \
install -m 0755 "/tmp/golangci-lint-${gcl_ver}-${go_arch}/golangci-lint" /usr/local/bin/golangci-lint; \
rm -rf /tmp/gcl.tgz "/tmp/golangci-lint-${gcl_ver}-${go_arch}"; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app