Loading
Build gitlab-tofu-ctl without cgo
Build gitlab-tofu-ctl with CGO_ENABLED=0 in Dockerfile.alpine and Dockerfile.debian.
The Debian builder (golang:1.27.3-trixie) has gcc, so cgo was on and the binary linked dynamically against glibc, although the Dockerfile comment said "static linking". Alpine was already static by accident.
With cgo off, Go uses its pure-Go DNS resolver. gitlab-tofu-ctl only talks HTTPS to the GitLab API and uses neither os/user nor net lookups directly.
Verified by building the builder stage of both images:
- Debian before:
lddshowslibc.so.6andld-linux-aarch64.so.1 - Debian after:
not a dynamic executable - Alpine after:
statically linked gitlab-tofu-ctl --helpruns in both
Stacked on !596 (merged).