About debugging the issue "glibc version not found"
Recently, I wanna build an image from the
previous Dockerfile (Which absolutely works fine before).
However, it stuck in
libc version not found when I ran it.
Here is my Dockerfile
FROM golang:1.20 AS so
Upon running the image, it throws:
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.29 not found(required by ffi-napi)
I realized that maybe the problem is in the second
node:18 image, so I changed it to
node:16, but the problem still exists; I tried
image again, still again.
After a lot of searching, I found that the
node:18 image was upgraded from the default system version
bookworm, so I tried to use
node:18-bullseye image, and the problem was solved.
Then, I dived into the second issue. ><...
After I fixed the 1st issue, it threw another error:
/lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32 not found(required by my golang dynamic lib)
Due to the experience of the first issue, after confirming that the
golang image has this version
golang:1.20-bullseye, I immediately tried
golang:1.20-bullseye image, but the problem was not solved as I expected. Sad.
After a long time of thinking, I suddenly realized that maybe the system version(Ubuntu 22) of my docker is too high?
I immediately tried to use my Ubuntu 18.04 system version to run, and the problem was solved! Wonderful!!!
golang:1.20-bullseye is necessary, if not, it still
/lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32 not found
FROM golang:1.20-bullseye AS so
- When using FROM in Dockerfile, not only need to specify the software version, but also need to specify the system version
- The host system version of Docker is not easy to control, just don't be too high or too low