The static image build links glibc's getaddrinfo and dlopen, which the Alpine runtime cannot satisfy #525

Closed
opened 2026-10-13 09:58:00 +02:00 by clawbot · 1 comment
Collaborator

Severity: low (a linker warning; nothing has been seen to fail).

The image's static relink (Dockerfile, the CGO_ENABLED=1 make build ... GO_LDFLAGS='-extldflags "-static"' step) links glibc statically, and the linker warns twice:

  • getaddrinfo (from the Go net package's cgo resolver): "Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking".
  • dlopen (from mattn/go-sqlite3's extension loading, unixDlOpen): the same warning.

The runtime image is Alpine, which has no glibc. Go normally picks its own DNS resolver there, so lookups work today, but anything that makes it choose the cgo resolver (for example GODEBUG=netdns=cgo) would make every lookup for a delivery target fail. SQLite extension loading is never used.

Done when the static build uses the standard build tags netgo and osusergo (Go's own resolver and user lookup, no cgo for either) and sqlite_omit_load_extension (no dlopen). The image build then prints neither warning, and the built image still delivers an event to an http target addressed by host name.

Model: opus-5-5

Severity: low (a linker warning; nothing has been seen to fail). The image's static relink (`Dockerfile`, the `CGO_ENABLED=1 make build ... GO_LDFLAGS='-extldflags "-static"'` step) links glibc statically, and the linker warns twice: - `getaddrinfo` (from the Go `net` package's cgo resolver): "Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking". - `dlopen` (from `mattn/go-sqlite3`'s extension loading, `unixDlOpen`): the same warning. The runtime image is Alpine, which has no glibc. Go normally picks its own DNS resolver there, so lookups work today, but anything that makes it choose the cgo resolver (for example `GODEBUG=netdns=cgo`) would make every lookup for a delivery target fail. SQLite extension loading is never used. Done when the static build uses the standard build tags `netgo` and `osusergo` (Go's own resolver and user lookup, no cgo for either) and `sqlite_omit_load_extension` (no `dlopen`). The image build then prints neither warning, and the built image still delivers an event to an `http` target addressed by host name. Model: opus-5-5
clawbot self-assigned this 2026-10-13 09:58:00 +02:00
Author
Collaborator

#526 builds the image's static binary with the build tags netgo, osusergo and sqlite_omit_load_extension, passed through a new GO_TAGS variable in the Makefile's build target. A plain make build and the test stage are unchanged.

Model: opus-5-5

https://git.eeqj.de/sneak/webhooker/pulls/526 builds the image's static binary with the build tags `netgo`, `osusergo` and `sqlite_omit_load_extension`, passed through a new `GO_TAGS` variable in the Makefile's build target. A plain `make build` and the test stage are unchanged. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#525