Skip to content

Commit 740a186

Browse files
Disable micrsoft/go build telemetry (#5037)
* Disable micrsoft/go build telemetry * update docs
1 parent 8b6dc74 commit 740a186

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Dockerfile.fips

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ENV PATH="$PATH:/go/bin"
1717
ENV FIPS=true
1818
ENV CGO_ENABLED=1
1919
ENV MAGEFILE_CACHE=/fleet-server/build/.magefile
20+
ENV MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0
2021
ENTRYPOINT [ "mage" ]
2122
CMD [ "build:release" ]
2223

@@ -41,7 +42,7 @@ ARG DEV=""
4142
ARG SNAPSHOT=""
4243
ARG TARGETPLATFORM
4344

44-
RUN FIPS=true CGO_ENABLED=1 GCFLAGS="${GCFLAGS}" LDFLAGS="${LDFLAGS}" SNAPSHOT="${SNAPSHOT}" DEV="${DEV}" PLATFORMS="${TARGETPLATFORM}" mage build:release
45+
RUN MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0 FIPS=true CGO_ENABLED=1 GCFLAGS="${GCFLAGS}" LDFLAGS="${LDFLAGS}" SNAPSHOT="${SNAPSHOT}" DEV="${DEV}" PLATFORMS="${TARGETPLATFORM}" mage build:release
4546

4647
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest
4748
ARG VERSION

docs/fips.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ As we are using micrsoft/go as a base we follow their conventions.
1414

1515
Our FIPS changes require the `requirefips` and `ms_tls13kdf` buildtags.
1616
When compiling `GOEXPERIMENT=systemcrypto` and `CGO_ENABLED=1` must be set.
17+
Additionally the `MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0` env var is set to disable telemetry for [microsoft/go](https://github.com/microsoft/go).
1718

1819
The `FIPS=true` env var is used by our magefile as the FIPS toggle.
1920
This env var applies to all targets, at a minimum the `requirefips` and `ms_tls13kdf` tags will be set.

magefile.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ func environMap() map[string]string {
363363
func addFIPSEnvVars(env map[string]string) {
364364
env["GOEXPERIMENT"] = "systemcrypto"
365365
env["CGO_ENABLED"] = "1"
366+
env["MS_GOTOOLCHAIN_TELEMETRY_ENABLED"] = "0"
366367
}
367368

368369
// teeCommand runs the specified command, stdout and stederr will be written to stdout and will be collected and returned.

0 commit comments

Comments
 (0)