soccer-bot/Dockerfile

19 lines
471 B
Docker

FROM golang:1.10 AS builder
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
ARG ROOT_IMPORT_PATH=git.icedream.tech/icedream/soccer-bot
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 /soccer-bot "$ROOT_IMPORT_PATH"
###
FROM scratch
COPY --from=builder /soccer-bot /
COPY main.tpl .
ENTRYPOINT ["/soccer-bot"]