diff --git a/Dockerfile b/Dockerfile index 1ac34cdd9e5ddc49a9e9c3fa6c6bd6a300dba05f..3f4d9cbf24841a7575388ac5b1c254c9fb22bd32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,13 @@ FROM golang:${GO_VERSION}-alpine as build # Necessary to run 'go get' and to compile the linked binary RUN apk add git musl-dev mailcap -ADD . /go/src/github.com/dutchcoders/transfer.sh - WORKDIR /go/src/github.com/dutchcoders/transfer.sh -ENV GO111MODULE=on +COPY go.mod go.sum ./ + +RUN go mod download + +COPY . . # build & install server RUN CGO_ENABLED=0 go build -tags netgo -ldflags "-X github.com/dutchcoders/transfer.sh/cmd.Version=$(git describe --tags) -a -s -w -extldflags '-static'" -o /go/bin/transfersh