This repository was archived by the owner on Feb 18, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.binaries
More file actions
32 lines (28 loc) · 1.46 KB
/
Copy pathDockerfile.binaries
File metadata and controls
32 lines (28 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# syntax=docker/dockerfile:1.7-labs
FROM ghcr.io/beetlebugorg/go-dims:builder AS go-dims
ARG TARGETARCH
RUN apk add zip
COPY --exclude=build . /build/go-dims
RUN --mount=type=cache,target=/gomod-cache --mount=type=cache,target=/go-cache \
cd go-dims && \
go env -w GOCACHE=/go-cache && \
go env -w GOMODCACHE=/gomod-cache && \
go mod download && \
make static
# Generate sbom for binary distribution
RUN sh go-dims/scripts/install-syft.sh && \
cd go-dims && mkdir build/sbom && \
/build/bin/syft file:build/dims -o spdx-json > build/sbom/go-dims.sbom.spdx.json && \
cp /build/apk.sbom.cdx.json build/sbom/apk.sbom.cdx.json && \
cp /usr/local/dims/libpng/sbom.cdx.json build/sbom/libpng.sbom.cdx.json && \
cp /usr/local/dims/libwebp/sbom.cdx.json build/sbom/libwebp.sbom.cdx.json && \
cp /usr/local/dims/libtiff/sbom.cdx.json build/sbom/libtiff.sbom.cdx.json && \
cp /usr/local/dims/glib-2.0/sbom.cdx.json build/sbom/glib-2.0.sbom.cdx.json && \
cp /usr/local/dims/libvips/sbom.cdx.json build/sbom/libvips.sbom.cdx.json && \
/build/bin/syft dir:build/sbom -o cyclonedx-json > build/sbom.cdx.json
RUN cd go-dims && strip build/dims && upx build/dims && \
cp NOTICE build/NOTICE && cp LICENSE build/LICENSE && \
cd build && zip dims-linux-${TARGETARCH}.zip dims sbom.cdx.json LICENSE NOTICE
FROM scratch AS export
ARG TARGETARCH
COPY --from=go-dims /build/go-dims/build/dims-linux-${TARGETARCH}.zip /dims-linux-${TARGETARCH}.zip