-
Notifications
You must be signed in to change notification settings - Fork 1
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
2 changed files
with
25 additions
and
15 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.vscode | ||
.task | ||
.vscode |
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,20 +1,30 @@ | ||
FROM golang:1.23.3-alpine as builder | ||
|
||
RUN apk update && apk add --no-cache git ca-certificates tzdata && update-ca-certificates | ||
|
||
RUN mkdir /app | ||
FROM golang:1.23.3-alpine AS builder | ||
ENV CGO_ENABLED=0 \ | ||
GOARCH=amd64 \ | ||
GOOS=linux \ | ||
PROJECT_NAME=mcvs-integrationtest-services | ||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
COPY . . | ||
|
||
ARG APPLICATION=mcvs-integrationtest-services | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o main ./cmd/$APPLICATION | ||
RUN apk update && \ | ||
apk add \ | ||
--no-cache \ | ||
ca-certificates=~20240705-r0 \ | ||
git=~2 \ | ||
tzdata=~2024 && \ | ||
update-ca-certificates && \ | ||
go mod download && \ | ||
go build \ | ||
-a \ | ||
-installsuffix cgo \ | ||
-o main \ | ||
./cmd/${PROJECT_NAME} && \ | ||
adduser -D -u 1000 ${PROJECT_NAME} | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /etc/group /etc/group | ||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /app/main ./main | ||
CMD ["./main"] | ||
COPY --from=builder /app/main /app/main | ||
USER mcvs-integrationtest-services | ||
ENTRYPOINT ["/app/main"] |