I have a Quarkus application that is used to build a native-micro container image. The image is built in a GitHub Action. However, when I run it on my Windows laptop using docker-compose I receive the following error.
./application: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./application)
./application: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./application)
The container image is built in a GitHub Action where the following is the output of the step for building the container image. The Docker Desktop on my Windows laptop is v4.21.1.
Yes and no. Containers will not solve all the problems, but if you build and run the application in the same container or at least based on the same image, you shouldn’t have problem with the version of the libraries. In some cases it is also important that the Docker version is compatible with the operating system in the container which sends system calls through Docker.
So based on the shared sources I guess there is a difference between the image on your Windows and the one available in GitHub Actions. How do you refer to the base image?
The image is pushed to ghcr.io by GitHub Actuon. The same image (:latest) is pulled and ran on my Windows laptop. I can verify with SHA sums too, but, pretty sure the images are the same.
Is the issue due to difderent versions of docker runtime? Or, way the binary image is packaged as container?
So, the issue is not with Quarkus base image. Instead with container runtime (docker, podman, containerd, etc.) Or, with the host where container runtime is installed?
Sorry for the late answer. The application itself of course uses libraries that are in the container which comes from the base image. Issues with the docker version matter only when there is a system call sent by an app from inside the container and the system call is not compatible with Docker. I’m not entirely sure how it works. I had the system call issue once and never after but I read about issues from others too. I alsou encountered other issues as well like when an image could be built only on one server and other servers could not run the container or rebuild the image until some changis in the application’s config. I never found out why it happened I only suspected some CPU specific dependency.
Unfortunately I don’t know the answer to your problem, but it looks like someone else just had a similar issue:
I ran the ldd --version command in the GitHub Action pipeline to understand the glibc version in the runner. I also ran the same command for the Quarkus image for native-micro. The glibc version in Quarkus image turned out to be older - hence, the error.
Therefore, at the moment, I have two choices.
Identify builder machine proportionate to the glibc version in Quarkus base image
Identify a build machine with the right level of operating system and therefore, glibc version. The right level here means, the same as the one used in the Quarkus base image. This is not easy with the GitHub Actions as the matching glibc will require “old” OS that are not found (see here as an example - DistroWatch.com: CentOS ) in GitHub Actions. The alternative is to use a self-hosted runner but, even there, the required OS might be a challenge for various IaaS providers.
Identify alternative micro base image that has a recent glibc version
Use an alternative base image with a “recent” glibc version that can run the generated binary. In other words, rather than looking for right build machine, I am looking for a base image where I can run my binary that was generated on a “recent” build machine.
I am more hopeful of second one. I am now looking for the “tiniest” image with the latest glibc. Any quick thoughts?