mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
support go mod cache for dockerfile
This commit is contained in:
parent
bee06ea192
commit
3fa74164fc
|
@ -5,8 +5,11 @@ RUN apk add --no-cache git ca-certificates gcc libc-dev pkgconfig
|
||||||
RUN go get -u github.com/c9s/goose/cmd/goose
|
RUN go get -u github.com/c9s/goose/cmd/goose
|
||||||
ADD . $GOPATH/src/github.com/c9s/bbgo
|
ADD . $GOPATH/src/github.com/c9s/bbgo
|
||||||
WORKDIR $GOPATH/src/github.com/c9s/bbgo
|
WORKDIR $GOPATH/src/github.com/c9s/bbgo
|
||||||
# RUN GOPATH=$PWD/.mod go install ./cmd/bbgo
|
ARG GO_MOD_CACHE
|
||||||
RUN go install ./cmd/bbgo
|
ENV GOPATH_ORIG=$GOPATH
|
||||||
|
ENV GOPATH=${GO_MOD_CACHE:+$PWD/$GO_MOD_CACHE}
|
||||||
|
ENV GOPATH=${GOPATH:-$GOPATH_ORIG}
|
||||||
|
RUN go build -o $GOPATH_ORIG/bin/bbgo ./cmd/bbgo
|
||||||
|
|
||||||
# Second stage container
|
# Second stage container
|
||||||
FROM alpine:3.12
|
FROM alpine:3.12
|
||||||
|
|
Loading…
Reference in New Issue
Block a user