From 6973354d2bdc1c9cf6b1640510c213a34e0aa01b Mon Sep 17 00:00:00 2001 From: Parithosh Jayanthi Date: Thu, 22 Dec 2022 15:18:56 +0100 Subject: [PATCH] updated dockerfile with builder step (#15) --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 61e7463..79840e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:latest AS builder +FROM golang:1.19.4-alpine3.17 AS builder WORKDIR /build # Copy and download dependencies using go mod @@ -9,9 +9,11 @@ RUN go mod download # Copy the code into the container COPY . . -RUN go test ./... # Build the application -RUN cd cmd/livefuzzer && GOOS=linux go build -o tx-fuzz.bin . +RUN cd cmd/livefuzzer && CGO_ENABLED=0 GOOS=linux go build -o tx-fuzz.bin . -ENTRYPOINT ["/build/cmd/livefuzzer/tx-fuzz.bin"] -CMD ["/build/cmd/livefuzzer/tx-fuzz.bin"] \ No newline at end of file +FROM alpine:latest + +COPY --from=builder /build/cmd/livefuzzer/tx-fuzz.bin /tx-fuzz.bin + +ENTRYPOINT ["/tx-fuzz.bin"] \ No newline at end of file