Skip to content

Commit

Permalink
updated dockerfile with builder step (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
parithosh committed Dec 22, 2022
1 parent cf9c3f8 commit 6973354
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
FROM alpine:latest

COPY --from=builder /build/cmd/livefuzzer/tx-fuzz.bin /tx-fuzz.bin

ENTRYPOINT ["/tx-fuzz.bin"]

0 comments on commit 6973354

Please sign in to comment.