blob: 2191e77264fbf0207bb9e12f5c213855dfbfeb69 [file] [log] [blame]
Mohammed Naserc6392302024-01-04 00:43:02 -05001VERSION 0.7
2ARG --global COMMIT=e8c2b17e1261c6a1b0fed1fcd5e1c337fc014219
3
4build:
5 FROM golang:1.21.5-bookworm
6 DO ../+APT_INSTALL --PACKAGES "patch"
7 GIT CLONE --branch ${COMMIT} https://opendev.org/airship/kubernetes-entrypoint /src
8 WORKDIR /src
9 RUN \
10 curl https://review.opendev.org/changes/airship%2Fkubernetes-entrypoint~904537/revisions/1/patch?download | \
11 base64 --decode | \
12 patch -p1
13 ARG GOARCH
14 RUN \
15 --mount=type=cache,mode=0755,target=/go/pkg/mod \
16 CGO_ENABLED=0 GOOS=linux go build -o /main
17 SAVE ARTIFACT /main
18
19platform-image:
20 FROM scratch
21 ARG TARGETARCH
22 COPY \
23 --platform=linux/amd64 \
24 (+build/main --GOARCH=$TARGETARCH) /kubernetes-entrypoint
25 USER 65534
26 ENTRYPOINT ["/kubernetes-entrypoint"]
27 SAVE IMAGE --push \
28 ghcr.io/vexxhost/atmosphere/kubernetes-entrypoint:${COMMIT} \
29 ghcr.io/vexxhost/atmosphere/kubernetes-entrypoint:latest
30
31image:
32 BUILD --platform linux/amd64 --platform linux/arm64 +platform-image