2019-04-29 21:25:34 +00:00
|
|
|
FROM golang:1.12 as builder
|
2019-11-22 16:27:28 +00:00
|
|
|
ENV GO111MODULE=on
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
ENV GOOS=linux
|
2019-04-29 21:25:34 +00:00
|
|
|
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends upx
|
|
|
|
# Run after `apt-get update` to improve rebuild scenarios
|
|
|
|
COPY . .
|
|
|
|
RUN make cloudflared
|
|
|
|
RUN upx --no-progress cloudflared
|
|
|
|
|
|
|
|
FROM gcr.io/distroless/base
|
|
|
|
COPY --from=builder /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
|
|
|
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
|
|
|
CMD ["version"]
|