quickstarts/tutorials/distributed-calculator/go/Dockerfile

11 lines
271 B
Docker

#first stage - builder
FROM golang:1.22-bookworm as builder
WORKDIR /dir
COPY app.go go.mod go.sum ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
#second stage
FROM debian:bookworm-slim
WORKDIR /root/
COPY --from=builder /dir/app .
CMD ["./app"]