Skip to content

Commit

Permalink
Adjust dockerfile to my liking
Browse files Browse the repository at this point in the history
  • Loading branch information
pgporada committed May 20, 2024
1 parent 9a89f5d commit d19cc94
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21.4-bookworm AS build

VOLUME . /go/src/app

WORKDIR /go/src/app
COPY . .
RUN go mod download

ENV CGO_ENABLED=0

RUN GOOS=$TARGETOS GOARCH=$TARGETPLATFORM go build -v -o /go/bin/unbound_exporter ./...
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETPLATFORM go build -v -o /go/bin/unbound_exporter

FROM gcr.io/distroless/static-debian12

COPY --from=build /go/bin/unbound_exporter /

ENTRYPOINT ["/unbound_exporter"]

0 comments on commit d19cc94

Please sign in to comment.