-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (20 loc) · 729 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (20 loc) · 729 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
# syntax=docker/dockerfile:1
FROM golang:1.24 AS builder
# Set destination for COPY
WORKDIR /workspace
# Download Go modules
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/gaip_linux_amd64 cmd/main.go
##
## Deploy the application binary into a lean image
##
FROM gcr.io/distroless/static
LABEL org.opencontainers.image.title="gaip" \
org.opencontainers.image.source="https://github.com/qclaogui/gaip" \
org.opencontainers.image.description="Practices for implementing Google API Improvement Proposals (AIP) in Go."
COPY --from=builder bin/gaip_linux_amd64 /bin/gaip
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/bin/gaip"]