From fbc89c4dd0db1f3f70047bb5eb15f72b4d20ce27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BA=9A=E6=96=B0?= Date: Tue, 11 Dec 2018 15:22:34 +0800 Subject: [PATCH] add Dockerfile --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4920d79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +#Builder image +FROM golang:1.10.1-alpine as builder + +RUN apk add --no-cache \ + make \ + git + +COPY . /go/src/github.com/tipsio/tips + +WORKDIR /go/src/github.com/tipsio/tips/tipsd + +RUN env GOOS=linux CGO_ENABLED=0 go build + +# Executable image +#FROM debian:stretch-slim +FROM scratch + +COPY --from=builder /go/src/github.com/tipsio/tips/tipsd/tipsd /tips/bin/tipsd +COPY --from=builder /go/src/github.com/tipsio/tips/conf/tips.toml /tips/conf/tips.toml + +WORKDIR /tips + +EXPOSE 7369 + +ENTRYPOINT ["./bin/tipsd"] + +