diff --git a/dnsseeder/docker/Dockerfile b/dnsseeder/docker/Dockerfile index 56cd3a297..0bfdc6a3e 100644 --- a/dnsseeder/docker/Dockerfile +++ b/dnsseeder/docker/Dockerfile @@ -12,12 +12,17 @@ RUN go get -u golang.org/x/lint/golint \ github.com/opennota/check/cmd/structcheck \ github.com/opennota/check/cmd/varcheck -COPY . . - # GO111MODULE=on forces Go to use the go-module system # TODO: remove this once Go 1.13 is released ENV GO111MODULE=on +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY . . + RUN go vet ./... # RUN aligncheck ./... # RUN structcheck -e ./... diff --git a/docker/Dockerfile b/docker/Dockerfile index 0bbba6ba0..804a27b87 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,12 +12,17 @@ RUN go get -u golang.org/x/lint/golint \ github.com/opennota/check/cmd/structcheck \ github.com/opennota/check/cmd/varcheck -COPY . . - # GO111MODULE=on forces Go to use the go-module system # TODO: remove this once Go 1.13 is released ENV GO111MODULE=on +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY . . + RUN TEST_DIRS=`go list -f {{.Dir}} ./... | grep -v /vendor/` GOFMT_RESULT=`gofmt -l $TEST_DIRS`; echo $GOFMT_RESULT; test -z "$GOFMT_RESULT" RUN go vet ./... RUN TEST_DIRS=`go list -f {{.Dir}} ./... | grep -v /vendor/` golint -set_exit_status $TEST_DIRS diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 9b3c1a013..87988457c 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -12,12 +12,17 @@ RUN apk add --no-cache libc6-compat RUN go get github.com/derekparker/delve/cmd/dlv -COPY . . - # GO111MODULE=on forces Go to use the go-module system # TODO: remove this once Go 1.13 is released ENV GO111MODULE=on +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY . . + RUN CGO_ENABLED=0 GOOS=linux go build -gcflags "all=-N -l" -a -installsuffix cgo -o btcd . ENTRYPOINT [ "/sbin/tini", "--" ] diff --git a/mining/simulator/docker/Dockerfile b/mining/simulator/docker/Dockerfile index 4424e7d1b..c5fb7fe98 100644 --- a/mining/simulator/docker/Dockerfile +++ b/mining/simulator/docker/Dockerfile @@ -7,12 +7,17 @@ WORKDIR /go/src/github.com/daglabs/btcd RUN apk add --no-cache curl git -COPY . . - # GO111MODULE=on forces Go to use the go-module system # TODO: remove this once Go 1.13 is released ENV GO111MODULE=on +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY . . + RUN cd mining/simulator && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o mining_simulator . # --- multistage docker build: stage #2: runtime image