fix(dev): replace binutils-gold with CGO_ENABLED=0 in dev images#6292
Conversation
binutils-gold was added to work around 'cannot find ld' on linux/arm64 alpine when 'go install' of dev tools (air, golangci-lint, mockery) linked via cgo. The real trigger is Go's net/os/user packages compiling with cgo by default, not the tools themselves — they are pure Go. Replace the workaround with CGO_ENABLED=0 inline on each go install. This also drops build-base (gcc) where it was added only to support the cgo link step. gold is deprecated in binutils 2.44 (Jan 2025); Alpine will drop the package eventually. Closes #6285.
|
@danielgatis could you test this in your environment? You introduced |
|
/review |
|
Claude finished @gustavosbarreto's task in 10m 47s —— View job Code Review CompleteReviewed 6 files across code quality, security, testing, Go patterns, and architecture — no issues found. The code looks good as-is. The change is clean and consistent: To request another review round, comment |

Closes #6285.
Summary
binutils-goldwas added in feat: add device custom fields #6248 to fixcannot find 'ld'on linux/arm64 alpine when installing dev tools (air, golangci-lint, mockery).net/os/usercompiling with cgo by default, not the tools themselves — they are pure Go.binutils-gold(andbuild-basewhere it was added only to support the cgo link step) and useCGO_ENABLED=0inline on eachgo install.CGO_ENABLED=0is set inline only on the dev tool installs. App builds (viaair, or the productionbuilderstage) are unaffected.Verified on linux/arm64 (emulated):
binutils-gold/build-baseair -vandgolangci-lint --versionrun inside the arm64 imagego build -tags dockerof the agent succeeds inside the dev image and the resulting binary runs (agent --help)