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.lambda
More file actions
31 lines (27 loc) · 1.44 KB
/
Dockerfile.lambda
File metadata and controls
31 lines (27 loc) · 1.44 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
# 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 lambda
RUN sh go-dims/scripts/install-syft.sh && \
cd go-dims && mkdir build/sbom && \
/build/bin/syft file:build/bootstrap -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/bootstrap && upx build/bootstrap && \
cp NOTICE build/NOTICE && cp LICENSE build/LICENSE && \
cd build && zip lambda-linux-${TARGETARCH}.zip bootstrap sbom.cdx.json LICENSE NOTICE
FROM scratch AS export
ARG TARGETARCH
COPY --from=go-dims /build/go-dims/build/lambda-linux-${TARGETARCH}.zip /lambda-linux-${TARGETARCH}.zip