Install binutils-gold only for arm64 builds
Some checks failed
govulncheck / govulncheck (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled

Signed-off-by: Michael Moll <kvedulv@kvedulv.de>
This commit is contained in:
Michael Moll 2026-02-15 23:45:39 +01:00 committed by Brad Davidson
parent ed7141a2ed
commit 39ccf3e075
2 changed files with 9 additions and 4 deletions

View file

@ -6,8 +6,9 @@ RUN apk -U --no-cache add \
bash git gcc musl-dev docker vim less file curl wget ca-certificates jq linux-headers \
zlib-dev tar zip squashfs-tools npm coreutils python3 py3-pip openssl-dev libffi-dev libseccomp \
libseccomp-dev libseccomp-static make libuv-static sqlite-dev sqlite-static libselinux \
libselinux-dev zlib-dev zlib-static zstd pigz alpine-sdk binutils-gold btrfs-progs-dev \
libselinux-dev zlib-dev zlib-static zstd pigz alpine-sdk btrfs-progs-dev \
btrfs-progs-static gawk yq pipx \
&& [ "$(go env GOARCH)" = "arm64" ] && apk -U --no-cache add binutils-gold || true \
&& [ "$(go env GOARCH)" = "amd64" ] && apk -U --no-cache add mingw-w64-gcc || true
# Install AWS CLI
@ -21,7 +22,7 @@ RUN case "$(go env GOARCH)" in \
s390x) TRIVY_ARCH="s390x" ;; \
*) TRIVY_ARCH="" ;; \
esac && \
if [ -n "${TRIVY_ARCH}" ]; then \
if [ -n "${TRIVY_ARCH}" ]; then \
wget --no-verbose "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-${TRIVY_ARCH}.tar.gz" \
&& tar -zxvf "trivy_${TRIVY_VERSION}_Linux-${TRIVY_ARCH}.tar.gz" \
&& mv trivy /usr/local/bin; \
@ -37,7 +38,7 @@ RUN rm -rf /go/src /go/pkg
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/refs/tags/v2.7.2/install.sh | sh -s -- v2.7.2; \
fi
# Set SELINUX environment variable
ARG SELINUX=true
ENV SELINUX=${SELINUX}

View file

@ -4,7 +4,11 @@ FROM ${GOLANG} AS infra
RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget ca-certificates jq linux-headers \
zlib-dev tar zip squashfs-tools npm coreutils openssl-dev libffi-dev libseccomp libseccomp-dev \
libseccomp-static make libuv-static sqlite-dev sqlite-static libselinux libselinux-dev zlib-dev zlib-static \
zstd pigz alpine-sdk binutils-gold btrfs-progs-dev btrfs-progs-static gawk yq pipx \
zstd pigz alpine-sdk btrfs-progs-dev btrfs-progs-static gawk yq pipx \
&& \
if [ "$(go env GOARCH)" = "arm64" ]; then \
apk -U --no-cache add binutils-gold; \
fi \
&& \
if [ "$(go env GOARCH)" = "amd64" ]; then \
apk -U --no-cache add mingw-w64-gcc; \