From 2714d10d62fee962bab19d07bd2ef164ee15dc22 Mon Sep 17 00:00:00 2001 From: Luis Neto Date: Fri, 20 Dec 2024 08:24:12 -0800 Subject: [PATCH] TUN-8829: add CONTAINER_BUILD to dockerfiles Closes TUN-8829 --- Dockerfile | 10 ++++++---- Dockerfile.amd64 | 5 ++++- Dockerfile.arm64 | 5 ++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39307965..66674c2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,12 @@ ARG TARGET_GOOS ARG TARGET_GOARCH FROM golang:1.22.5 as builder ENV GO111MODULE=on \ - CGO_ENABLED=0 \ - TARGET_GOOS=${TARGET_GOOS} \ - TARGET_GOARCH=${TARGET_GOARCH} \ - CONTAINER_BUILD=1 + CGO_ENABLED=0 \ + TARGET_GOOS=${TARGET_GOOS} \ + TARGET_GOARCH=${TARGET_GOARCH} \ + # the CONTAINER_BUILD envvar is used set github.com/cloudflare/cloudflared/metrics.Runtime=virtual + # which changes how cloudflared binds the metrics server + CONTAINER_BUILD=1 WORKDIR /go/src/github.com/cloudflare/cloudflared/ diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index d1cdbcbf..c375d801 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -1,7 +1,10 @@ # use a builder image for building cloudflare FROM golang:1.22.5 as builder ENV GO111MODULE=on \ - CGO_ENABLED=0 + CGO_ENABLED=0 \ + # the CONTAINER_BUILD envvar is used set github.com/cloudflare/cloudflared/metrics.Runtime=virtual + # which changes how cloudflared binds the metrics server + CONTAINER_BUILD=1 WORKDIR /go/src/github.com/cloudflare/cloudflared/ diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 0190bf63..b617d7ae 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -1,7 +1,10 @@ # use a builder image for building cloudflare FROM golang:1.22.5 as builder ENV GO111MODULE=on \ - CGO_ENABLED=0 + CGO_ENABLED=0 \ + # the CONTAINER_BUILD envvar is used set github.com/cloudflare/cloudflared/metrics.Runtime=virtual + # which changes how cloudflared binds the metrics server + CONTAINER_BUILD=1 WORKDIR /go/src/github.com/cloudflare/cloudflared/