soccer-bot/Dockerfile

19 lines
471 B
Docker
Raw Normal View History

FROM golang:1.10 AS builder
2017-08-08 16:32:45 +00:00
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
2018-06-02 23:04:29 +00:00
ARG ROOT_IMPORT_PATH=git.icedream.tech/icedream/soccer-bot
2017-08-08 16:32:45 +00:00
COPY . /go/src/app
RUN \
mkdir -p "$GOPATH/src/$(dirname "$ROOT_IMPORT_PATH")" &&\
ln -sf "$GOPATH/src/app" "$GOPATH/src/$ROOT_IMPORT_PATH" &&\
2018-06-02 23:20:10 +00:00
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o /soccer-bot "$ROOT_IMPORT_PATH"
2017-08-08 16:32:45 +00:00
###
FROM scratch
2018-06-02 23:04:29 +00:00
COPY --from=builder /soccer-bot /
2018-06-02 23:26:49 +00:00
COPY main.tpl .
2018-06-02 23:04:29 +00:00
ENTRYPOINT ["/soccer-bot"]