Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ RUN make cloudflared

# use a distroless base image with glibc
FROM gcr.io/distroless/base-debian13:nonroot
# Enable metrics for healthcheck
ENV TUNNEL_METRICS=127.0.0.1:60123

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

Expand All @@ -33,6 +35,10 @@ COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cl
# The `nonroot` user maps to `65532`, from: https://github.com/GoogleContainerTools/distroless/blob/main/common/variables.bzl#L18
USER 65532:65532

# Check if cloudflared is healthy
HEALTHCHECK --interval=30s --timeout=30s --retries=3 \
CMD cloudflared tunnel --metrics localhost:60123 ready

# command / entrypoint of container
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
CMD ["version"]
6 changes: 6 additions & 0 deletions Dockerfile.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RUN GOOS=linux GOARCH=amd64 make cloudflared

# use a distroless base image with glibc
FROM gcr.io/distroless/base-debian13:nonroot
# Enable metrics for healthcheck
ENV TUNNEL_METRICS=127.0.0.1:60123

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

Expand All @@ -28,6 +30,10 @@ COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cl
# The `nonroot` user maps to `65532`, from: https://github.com/GoogleContainerTools/distroless/blob/main/common/variables.bzl#L18
USER 65532:65532

# Check if cloudflared is healthy
HEALTHCHECK --interval=30s --timeout=30s --retries=3 \
CMD cloudflared tunnel --metrics localhost:60123 ready

# command / entrypoint of container
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
CMD ["version"]
6 changes: 6 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RUN GOOS=linux GOARCH=arm64 make cloudflared

# use a distroless base image with glibc
FROM gcr.io/distroless/base-debian13:nonroot-arm64
# Enable metrics for healthcheck
ENV TUNNEL_METRICS=127.0.0.1:60123

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

Expand All @@ -28,6 +30,10 @@ COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cl
# The `nonroot` user maps to `65532`, from: https://github.com/GoogleContainerTools/distroless/blob/main/common/variables.bzl#L18
USER 65532:65532

# Check if cloudflared is healthy
HEALTHCHECK --interval=30s --timeout=30s --retries=3 \
CMD cloudflared tunnel --metrics localhost:60123 ready

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