chore: add Dockerfile with Go 1.25
Add multi-stage Dockerfile for building minimal container image using golang:1.25-alpine base.
This commit is contained in:
parent
219d26959f
commit
74ac653e58
1 changed files with 16 additions and 0 deletions
16
Dockerfile
Normal file
16
Dockerfile
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
FROM golang:1.25-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /resource-collector ./cmd/collector
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
COPY --from=builder /resource-collector /usr/local/bin/resource-collector
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/resource-collector"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue