/lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./server)

Published: Thursday, Sep 17, 2020 Last modified: Monday, Apr 8, 2024

Fix with Apex Up is to introduce a build hook:

  "hooks": { "build": "CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server *.go" },

Go static binaries assume GLIBC is compatible, and it turns out, Archlinux and AWS’s runtime differ!

[hendry@t14s ]$ lddtree ./server
 (interpreter => /lib64/ld-linux-x86-64.so.2)
	libpthread.so.0 => /usr/lib/libpthread.so.0
	libc.so.6 => /usr/lib/libc.so.6
[hendry@t14s ]$ CGO_ENABLED=0 go build
[hendry@t14s ]$ lddtree ./server
 (interpreter => None)

I’m not sure why by default Go’s static binaries depends on GLIBC