Skip to content

Commit

Permalink
fix dockerfile for go-sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Mar 1, 2023
1 parent 6f30b45 commit 4f0c986
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/linode
/frontend
/desktop
/data
/output
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# 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
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
Expand Down

0 comments on commit 4f0c986

Please sign in to comment.