stagex/packages/kustomize-sops/Containerfile

37 lines
1,008 B
Text
Raw Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
ENV VERSION=4.3.1
ENV SRC_HASH=e7248a158d503a73d9f658cc9ac0ccf16a3d8efb856d93ca50a97f7b89332516
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/viaduct-ai/kustomize-sops/archive/refs/tags/${SRC_FILE}
ENV GOPATH=/cache/go
ENV GOCACHE=/cache/
ENV GOWORK=off
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV GO11MODULE=off
2024-08-08 07:47:42 +00:00
FROM base AS fetch
COPY --from=stagex/busybox . /
COPY --from=stagex/go . /
COPY --from=stagex/ca-certificates . /
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
RUN tar -xvf ${SRC_FILE}
WORKDIR kustomize-sops-${VERSION}
RUN go get ./...
2024-08-08 07:47:42 +00:00
FROM fetch AS build
RUN --network=none go build -trimpath -v
2024-08-08 07:50:50 +00:00
FROM build AS install
RUN <<-EOF
2024-04-11 20:09:20 +00:00
set -eu
mkdir -p /rootfs/usr/lib/kustomize/plugins/viduct.ai/v1/ksops
cp kustomize-sops /rootfs/usr/lib/kustomize/plugins/viduct.ai/v1/ksops/ksops
EOF
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
COPY --from=install /rootfs/./ /