-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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,24 @@ | ||
FROM golang:1.23.1-alpine3.19@sha256:ac67716dd016429be8d4c2c53a248d7bcdf06d34127d3dc451bda6aa5a87bc06 AS builder | ||
|
||
ARG GOFLAGS="-trimpath -buildvcs=false -buildmode=exe" | ||
ENV GOFLAGS=$GOFLAGS | ||
|
||
# Move to working directory /build | ||
WORKDIR /build | ||
|
||
# Copy and download dependency using go mod | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
# Copy the code into the container | ||
COPY . . | ||
|
||
# Build the application | ||
RUN go build -o bin/sctfe-gcp ./cmd/gcp | ||
|
||
# Build release image | ||
FROM alpine:3.20.2@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5 | ||
|
||
COPY --from=builder /build/bin/sctfe-gcp /bin/sctfe-gcp | ||
ENTRYPOINT ["/bin/sctfe-gcp"] |