add a docker file and generate certs and more makefile notes
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Copy go mod files
|
||||
COPY go.mod go.mod
|
||||
COPY go.sum go.sum
|
||||
|
||||
# Cache dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY main.go main.go
|
||||
|
||||
# Build
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o webhook main.go
|
||||
|
||||
# Use distroless as minimal runtime image
|
||||
FROM gcr.io/distroless/static:nonroot
|
||||
|
||||
WORKDIR /
|
||||
COPY --from=builder /workspace/webhook .
|
||||
|
||||
USER 65532:65532
|
||||
|
||||
ENTRYPOINT ["/webhook"]
|
||||
Reference in New Issue
Block a user