2022-06-09 20:50:34 +02:00
|
|
|
##
|
|
|
|
# Compile application
|
|
|
|
##
|
2022-08-14 15:13:46 +02:00
|
|
|
FROM golang:alpine AS build-env
|
2022-06-09 20:50:34 +02:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
# ge dependencies
|
|
|
|
RUN go mod tidy
|
|
|
|
# build binary
|
|
|
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o oven-exporter
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Build Image
|
|
|
|
##
|
|
|
|
FROM scratch
|
2022-08-14 15:13:46 +02:00
|
|
|
COPY --from=build ["/etc/ssl/cert.pem", "/etc/ssl/certs/ca-certificates.crt"]
|
2022-06-09 20:50:34 +02:00
|
|
|
COPY --from=build-env /app/oven-exporter /oven-exporter
|
|
|
|
WORKDIR /
|
2022-08-14 15:13:46 +02:00
|
|
|
ENTRYPOINT ["/oven-exporter", "-c", "''"]
|