-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marco Franssen <[email protected]>
- Loading branch information
1 parent
292d5e0
commit 627190b
Showing
5 changed files
with
91 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
FROM golang:1.22-alpine AS builder | ||
ARG goversion=1.22 | ||
FROM --platform=${BUILDPLATFORM} golang:${goversion}-alpine AS base | ||
RUN mkdir build | ||
WORKDIR /build | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
RUN apk add --update --no-cache make git | ||
COPY go.* ./ | ||
RUN --mount=type=cache,target=/go/pkg/mod go mod download | ||
COPY . . | ||
RUN apk add --no-cache make git | ||
RUN make build | ||
|
||
FROM vault:1.13.3 AS vault-binary | ||
|
||
FROM alpine:3.19.1 AS certs | ||
RUN apk add --no-cache ca-certificates | ||
FROM --platform=${BUILDPLATFORM} base AS builder | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
make build | ||
|
||
FROM --platform=${BUILDPLATFORM} vault:1.13.3 AS vault-binary | ||
|
||
FROM --platform=${BUILDPLATFORM} alpine:3.19.1 AS certs | ||
RUN apk add --update --no-cache ca-certificates | ||
|
||
FROM busybox:1.36.1 | ||
ENTRYPOINT [ "/usr/local/bin/spiffe-vault" ] | ||
ENV VAULT_ADDR= | ||
LABEL maintainer="[email protected]" | ||
RUN mkdir -p /app | ||
WORKDIR /app | ||
ENV VAULT_ADDR= | ||
COPY --from=certs /etc/ssl/certs /etc/ssl/certs | ||
COPY --from=builder build/bin/spiffe-vault /usr/local/bin/spiffe-vault | ||
COPY --from=vault-binary bin/vault /usr/local/bin/vault | ||
ENTRYPOINT [ "/usr/local/bin/spiffe-vault" ] | ||
COPY --link --from=certs /etc/ssl/certs /etc/ssl/certs | ||
COPY --link --from=builder build/bin/spiffe-vault /usr/local/bin/spiffe-vault | ||
COPY --link --from=vault-binary bin/vault /usr/local/bin/vault |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters