open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.94k stars 1.32k forks source link

[cmd/builder] Disable CGO by default #10028

Open evan-bradley opened 3 weeks ago

evan-bradley commented 3 weeks ago

Is your feature request related to a problem? Please describe. When using a binary output by the builder with no options, I can't use it by default in a scratch image unless it is compiled with CGO_ENALBED=0.

Describe the solution you'd like Turn off CGO by default in the builder. Allow users to enable it through setting the CGO_ENABLED environment variable.

Additional context Our contributing guidelines forbid using CGO, and no upstream components I'm aware of use it. We also have CGO_ENABLED=0 set anywhere we build Collector binaries in upstream repositories.

Users have also run into this before: https://github.com/open-telemetry/opentelemetry-collector/issues/6373