From 081987b647b724b628f68bc68084341b3990d804 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 23 Mar 2025 14:44:39 +0100 Subject: [PATCH] Dockerfile: disable saving Golang telemetry in dev-container Disable collecting local telemetry, as collected by Go and Delve; - https://github.com/go-delve/delve/blob/v1.24.1/CHANGELOG.md#1231-2024-09-23 - https://go.dev/doc/telemetry#background Telemetry is only collected, and not sent by default, so let's skip producing it in the first place, as the dev-container is an ephemeral environment, and this telemetry is not used. Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9ba8d8bbb4..da1f57efe7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,11 @@ COPY --from=build-dummy /build /build # base FROM --platform=$BUILDPLATFORM ${GOLANG_IMAGE} AS base COPY --from=xx / / +# Disable collecting local telemetry, as collected by Go and Delve; +# +# - https://github.com/go-delve/delve/blob/v1.24.1/CHANGELOG.md#1231-2024-09-23 +# - https://go.dev/doc/telemetry#background +RUN go telemetry off && [ "$(go telemetry)" = "off" ] || { echo "Failed to disable Go telemetry"; exit 1; } RUN echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache RUN apt-get update && apt-get install --no-install-recommends -y file ENV GO111MODULE=off