Dockerfile
raw| 1 | #syntax=docker/dockerfile:1.5.1 |
| 2 | |
| 3 | FROM golang:1.20-alpine AS build |
| 4 | WORKDIR /go/src/exporter_exporter |
| 5 | COPY . . |
| 6 | ENV CGO_ENABLED=0 |
| 7 | ENV GOOS=linux |
| 8 | |
| 9 | RUN go mod download ;\ |
| 10 | go build -trimpath |
| 11 | |
| 12 | FROM gcr.io/distroless/static:latest AS runtime |
| 13 | COPY --from=build /go/src/exporter_exporter/exporter_exporter /exporter_exporter |
| 14 | ENTRYPOINT [ "/exporter_exporter" ] |