soccer-bot/Dockerfile

18 lines
454 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" &&\
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o /soccerbot "$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 /
ENTRYPOINT ["/soccer-bot"]