From 7469ba3829bcbc362da907364ee58cb3b972266c Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 14 Dec 2020 14:06:02 +0800 Subject: [PATCH] add Dockerfile --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..0291f6f79a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# First stage container +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 +# RUN GOPATH=$PWD/.mod go install ./cmd/bbgo +RUN go install ./cmd/bbgo + +# Second stage container +FROM alpine:3.12 + +# RUN apk add --no-cache ca-certificates +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"] +CMD ["run"] +# vim:filetype=dockerfile: