Build a docker container
Use debian/distroless (glibc) as a base which in general gives slightly higher performance than alpine (musl) while trading off container size (about 10mb). The build phase makes the assumption that any capnproto-files are pre-processed before building in-docker.
This commit is contained in:
parent
acd17f6ab6
commit
d3f9aa2ae7
|
@ -0,0 +1,12 @@
|
|||
FROM golang:1.12 as builder
|
||||
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"]
|
Loading…
Reference in New Issue