18 lines
440 B
Docker
18 lines
440 B
Docker
FROM golang:1.10 AS builder
|
|
|
|
RUN mkdir -p /go/src/app
|
|
WORKDIR /go/src/app
|
|
|
|
ARG ROOT_IMPORT_PATH=github.com/icedream/embot
|
|
COPY . /go/src/app
|
|
RUN \
|
|
mkdir -p "$GOPATH/src/$(dirname "$ROOT_IMPORT_PATH")" &&\
|
|
ln -sf "$GOPATH/src/app" "$GOPATH/src/$ROOT_IMPORT_PATH" &&\
|
|
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o /soccerbot "$ROOT_IMPORT_PATH"
|
|
|
|
###
|
|
|
|
FROM scratch
|
|
COPY --from=builder /soccerbot /
|
|
ENTRYPOINT ["/soccerbot"]
|