-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version display on unleash index (#126)
- Loading branch information
1 parent
4f640e0
commit eca002a
Showing
15 changed files
with
2,173 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.* | ||
.*/ | ||
bin/ | ||
charts/ | ||
hack/ | ||
tmp/ | ||
CODEOWNERS | ||
Dockerfile | ||
flake.* |
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 +1 @@ | ||
golang 1.20.7 | ||
golang 1.21.1 |
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,22 +1,31 @@ | ||
FROM golang:1.20-alpine as builder | ||
RUN apk add --no-cache git make curl build-base | ||
ENV GOOS=linux | ||
# Build the bifrost binary | ||
FROM golang:1.21 as builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
WORKDIR /src | ||
|
||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
WORKDIR /workspace | ||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
# cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN go mod download | ||
|
||
COPY . ./ | ||
RUN make test | ||
RUN make check | ||
RUN make alpine | ||
# Copy the go source | ||
COPY . . | ||
|
||
# Build | ||
# the GOARCH has not a default value to allow the binary be built according to the host where the command | ||
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO | ||
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, | ||
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bifrost main.go | ||
|
||
# Use distroless as minimal base image to package the bifrost binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=builder /workspace/bifrost . | ||
USER 65532:65532 | ||
|
||
FROM alpine:3.18 | ||
RUN apk add --no-cache ca-certificates tzdata | ||
RUN export PATH=$PATH:/app | ||
WORKDIR /app | ||
COPY --from=builder /src/bin/bifrost /app/bifrost | ||
COPY --from=builder /src/templates /app/templates | ||
CMD ["/app/bifrost"] | ||
ENTRYPOINT ["/bifrost"] |
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
Oops, something went wrong.