Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Cloudflared/2026.9.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM --platform=$BUILDPLATFORM golang:1.26.8 AS builder

ARG TARGETOS
ARG TARGETARCH
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOPROXY=https://proxy.golang.org|direct \
TARGET_GOOS=${TARGETOS} \
TARGET_GOARCH=${TARGETARCH} \
CONTAINER_BUILD=1 \
CLOUDFLARED_VERSION=2026.9.3
WORKDIR /go/src/github.com/cloudflare/cloudflared/

# copy our sources into the builder image
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .

# Download dependencies separately from compilation.
RUN go mod download

# compile cloudflared
RUN GOOS=${TARGET_GOOS} GOARCH=${TARGET_GOARCH} make cloudflared

# use a distroless base image with glibc
FROM gcr.io/distroless/base-debian13:nonroot@sha256:0896741ba5bafd3ac87ea025a5f578952f2d238ddc3614cb368acc983a687aa2

LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"

# copy our compiled binary
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/

# run as nonroot user
USER 65532:65532

# command / entrypoint of container
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
CMD ["version"]
Loading