diff --git a/Dockerfile b/Dockerfile index 5419d4703..060eecc32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,8 @@ RUN cd /usr/local/bin && unzip vault_${vault_version}_linux_amd64.zip WORKDIR /go/src/github.com/fabiolb/fabio COPY . . -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -ldflags "-s -w" ./... -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -mod=vendor -ldflags "-s -w" ./... +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "-s -w" FROM alpine:3.8 RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* diff --git a/Makefile b/Makefile index 269e6fa94..b999fa96a 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,11 @@ help: # build compiles fabio and the test dependencies build: gofmt - go build + go build -mod=vendor # test runs the tests test: build - go test -v -test.timeout 15s `go list ./... | grep -v '/vendor/'` + go test -mod=vendor -v -test.timeout 15s /... # gofmt runs gofmt on the code gofmt: @@ -56,7 +56,7 @@ linux: # install runs go install install: - go install $(GOFLAGS) + go install -mod=vendor $(GOFLAGS) # pkg builds a fabio.tar.gz package with only fabio in it pkg: build test @@ -119,7 +119,7 @@ codeship: # clean removes intermediate files clean: - go clean + go clean -mod=vendor rm -rf pkg dist fabio find . -name '*.test' -delete