diff --git a/.dockerignore b/.dockerignore index bccbeed7a5..6dfdf4f205 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,5 @@ /linode /frontend /desktop +/data +/output diff --git a/Dockerfile b/Dockerfile index d3f932f5a0..09a1f6482f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ # First stage container FROM golang:1.18.10-alpine3.17 AS builder -RUN apk add --no-cache git ca-certificates gcc libc-dev pkgconfig +RUN apk add --no-cache git ca-certificates gcc musl-dev libc-dev pkgconfig # gcc is for github.com/mattn/go-sqlite3 # ADD . $GOPATH/src/github.com/c9s/bbgo + WORKDIR $GOPATH/src/github.com/c9s/bbgo ARG GO_MOD_CACHE ENV WORKDIR=$GOPATH/src/github.com/c9s/bbgo @@ -11,8 +12,9 @@ ENV GOPATH_ORIG=$GOPATH ENV GOPATH=${GO_MOD_CACHE:+$WORKDIR/$GO_MOD_CACHE} ENV GOPATH=${GOPATH:-$GOPATH_ORIG} ENV CGO_ENABLED=1 -RUN cd $WORKDIR && go get github.com/mattn/go-sqlite3 +RUN cd $WORKDIR ADD . . +RUN go get github.com/mattn/go-sqlite3 RUN go build -o $GOPATH_ORIG/bin/bbgo ./cmd/bbgo # Second stage container