From 55dfb5405acbc742839c3f9806a6df2a7b97e034 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 28 Dec 2021 05:23:33 +0100 Subject: [PATCH] reworked dockerfile for local building --- docker/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 896c4d5..01b0131 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,12 @@ -FROM alpine:latest +FROM golang:latest as builder +WORKDIR /build +COPY . . +RUN go get -u +RUN CGO_ENABLED=0 go build -o probehost2 +FROM alpine:latest RUN apk update -RUN apk add curl jq -RUN curl -s https://api.github.com/repos/byReqz/probehost2/releases/latest | jq -r '.assets[].browser_download_url' | grep "probehost2" | xargs curl -L -o probehost2 -ENTRYPOINT ["/probehost2"] +RUN apk add mtr +COPY --from=builder /build/probehost2 / +RUN touch /probehost2.log +CMD ["/probehost2"]