If you’ve run a Go binary in an Alpine Linux distro, and your Go code depends on C libraries so you had CGO_ENABLED=1
, you might encounter this error: fork/exec /prog1: no such file or directory
. If so, run the commands to verify:
ldd /prog1
linux-vdso.so.1 (0x00007ffd415fb000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000737677400000) /lib64/ld-linux-x86-64.so.2 (0x000073767774a000)
file /prog1
/progr1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=56f9339293d160b8b13f9ffef5faaebc2c54e9cd, for GNU/Linux 3.2.0, with debug_info, not stripped
ldd
output shows that your binary requires libc.so.6
and /lib64/ld-linux-x86-64.so.2
file
confirms your binary is dynamically linked
You can install the missing dependencies knowing that.