24 lines
418 B
Text
24 lines
418 B
Text
|
FROM golang:1.21-alpine3.18 AS build_deps
|
||
|
|
||
|
RUN apk add --no-cache git
|
||
|
|
||
|
WORKDIR /workspace
|
||
|
|
||
|
COPY go.mod .
|
||
|
COPY go.sum .
|
||
|
|
||
|
RUN go mod download
|
||
|
|
||
|
FROM build_deps AS build
|
||
|
|
||
|
COPY . .
|
||
|
|
||
|
RUN CGO_ENABLED=0 go build -o webhook -ldflags '-w -extldflags "-static"' .
|
||
|
|
||
|
FROM alpine:3.18
|
||
|
|
||
|
RUN apk add --no-cache ca-certificates
|
||
|
|
||
|
COPY --from=build /workspace/webhook /usr/local/bin/webhook
|
||
|
|
||
|
ENTRYPOINT ["webhook"]
|