-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 692 Bytes
/
Dockerfile
File metadata and controls
34 lines (23 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Build Stage
ARG BUILDPLATFORM
FROM --platform=${BUILDPLATFORM} golang:1.26.1 AS build-stage
LABEL app="dishook"
LABEL REPO="https://github.com/astr0n8t/dishook"
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
# Copy all internal modules
COPY cmd/*.go ./cmd/
COPY config/*.go ./config/
COPY internal/*.go ./internal/
COPY version/*.go ./version/
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /dishook
# Deploy the application binary into a lean image
FROM gcr.io/distroless/static-debian11 AS build-release-stage
WORKDIR /
COPY --from=build-stage /dishook /dishook
USER nonroot:nonroot
ENTRYPOINT ["/dishook"]