FROM golang:1.12-alpine ENV PATH="${GOPATH}/bin:${PATH}" RUN mkdir -p /go/src/github.com/daglabs/btcd WORKDIR /go/src/github.com/daglabs/btcd RUN apk add --no-cache curl git openssh binutils gcc musl-dev tini bash # Allow delve to run on Alpine based containers. RUN apk add --no-cache libc6-compat RUN go get github.com/derekparker/delve/cmd/dlv # 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", "--" ]