Dockerfile.amd64 798 B

123456789101112131415161718192021222324252627282930
  1. # use a builder image for building cloudflare
  2. FROM golang:1.22.5 as builder
  3. ENV GO111MODULE=on \
  4. CGO_ENABLED=0
  5. WORKDIR /go/src/github.com/cloudflare/cloudflared/
  6. # copy our sources into the builder image
  7. COPY . .
  8. RUN .teamcity/install-cloudflare-go.sh
  9. # compile cloudflared
  10. RUN GOOS=linux GOARCH=amd64 PATH="/tmp/go/bin:$PATH" make cloudflared
  11. # use a distroless base image with glibc
  12. FROM gcr.io/distroless/base-debian11:nonroot
  13. LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
  14. # copy our compiled binary
  15. COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
  16. # run as non-privileged user
  17. USER nonroot
  18. # command / entrypoint of container
  19. ENTRYPOINT ["cloudflared", "--no-autoupdate"]
  20. CMD ["version"]