From f0f207ed984e18a8095e6188f81e8456629cfbb4 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 27 Dec 2021 18:22:54 +0800 Subject: [PATCH] fix dockerfile --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 859b3966c..e8b5d54ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,7 @@ FROM golang:1.15-alpine3.12 AS builder RUN apk add --no-cache git ca-certificates gcc libc-dev pkgconfig # gcc is for github.com/mattn/go-sqlite3 -RUN go get -u github.com/c9s/goose/cmd/goose # ADD . $GOPATH/src/github.com/c9s/bbgo -# WORKDIR $GOPATH/src/github.com/c9s/bbgo WORKDIR $GOPATH/src/github.com/c9s/bbgo ARG GO_MOD_CACHE @@ -12,6 +10,8 @@ ENV WORKDIR=$GOPATH/src/github.com/c9s/bbgo ENV GOPATH_ORIG=$GOPATH ENV GOPATH=${GO_MOD_CACHE:+$WORKDIR/$GO_MOD_CACHE} ENV GOPATH=${GOPATH:-$GOPATH_ORIG} +ENV CGO_ENABLED=1 +RUN go get github.com/mattn/go-sqlite3 ADD . . RUN go build -o $GOPATH_ORIG/bin/bbgo ./cmd/bbgo @@ -22,7 +22,6 @@ FROM alpine:3.12 RUN mkdir /app WORKDIR /app -COPY --from=builder /go/bin/goose /usr/local/bin COPY --from=builder /go/bin/bbgo /usr/local/bin ENTRYPOINT ["/usr/local/bin/bbgo"]