From e9ec4a23dd9f5dc3b530a10687c79ce56c0511bc Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Tue, 7 Mar 2023 21:56:36 +0800 Subject: [PATCH] dockerfile cleanup --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2af67b8..610b74a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,17 @@ FROM golang:1.19-alpine as builder -RUN apk --update --no-cache add make git g++ linux-headers +RUN apk --update --no-cache add gcc libc-dev # DEBUG RUN apk add busybox-extras # Get and build tx-spammer -ADD . /go/src/github.com/cerc-io/tx-spammer WORKDIR /go/src/github.com/cerc-io/tx-spammer -RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o tx-spammer . + +ENV GO111MODULE=on +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o tx-spammer . # app container FROM alpine