cloudflare/cloudflared

Public

mirrored from https://github.com/cloudflare/cloudflaredAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2021.12.4

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Dockerfile

29lines · modecode

1# use a builder image for building cloudflare
2ARG TARGET_GOOS
3ARG TARGET_GOARCH
4FROM golang:1.17.1 as builder
5ENV GO111MODULE=on \
6 CGO_ENABLED=0 \
7 TARGET_GOOS=${TARGET_GOOS} \
8 TARGET_GOARCH=${TARGET_GOARCH}
9
10WORKDIR /go/src/github.com/cloudflare/cloudflared/
11
12# copy our sources into the builder image
13COPY . .
14
15# compile cloudflared
16RUN make cloudflared
17
18# use a distroless base image with glibc
19FROM gcr.io/distroless/base-debian10:nonroot
20
21# copy our compiled binary
22COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
23
24# run as non-privileged user
25USER nonroot
26
27# command / entrypoint of container
28ENTRYPOINT ["cloudflared", "--no-autoupdate"]
29CMD ["version"]
30