Pass BUILDTAGS argument to go build

Signed-off-by: Marcus Pettersen Irgens <m@mrcus.dev>
This commit is contained in:
Marcus Pettersen Irgens 2023-05-19 18:38:27 +02:00
parent 7c354a4b40
commit ab7178cc0a
No known key found for this signature in database

View file

@ -27,7 +27,7 @@ RUN --mount=type=bind,target=/go/src/github.com/docker/distribution,rw \
--mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/root/.cache/go-build \
--mount=target=/go/pkg/mod,type=cache \ --mount=target=/go/pkg/mod,type=cache \
--mount=type=bind,source=/tmp/.ldflags,target=/tmp/.ldflags,from=version \ --mount=type=bind,source=/tmp/.ldflags,target=/tmp/.ldflags,from=version \
set -x ; xx-go build -trimpath -ldflags "$(cat /tmp/.ldflags) ${LDFLAGS}" -o /usr/bin/registry ./cmd/registry \ set -x ; xx-go build -trimpath -ldflags "$(cat /tmp/.ldflags) ${LDFLAGS}" -tags="${BUILDTAGS}" -o /usr/bin/registry ./cmd/registry \
&& xx-verify --static /usr/bin/registry && xx-verify --static /usr/bin/registry
FROM scratch AS binary FROM scratch AS binary