Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 27, 2021
1 parent 9dc4106 commit f0f207e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
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
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

Expand All @@ -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"]
Expand Down

0 comments on commit f0f207e

Please sign in to comment.