Open dfuhry opened 10 months ago
I notice in the Dockerfile that the mvn
command seems to specify build architecture native
:
https://github.com/observabilitystack/geoip-api/blob/master/Dockerfile#L11C1-L11C1
The Graalvm JDK 17 release notes in the third bullet mention:
"Use -march=compatibility for best compatibility or -march=native for best performance if a native executable is deployed on the same machine or on a machine with the same CPU features." https://www.graalvm.org/release-notes/JDK_17/
If this is indeed the issue I'm experiencing, then it seems adding a "compatibility" variant image, or switching builds to "compatibility" if there is no noticeable performance difference, would resolve it.
I built the project locally and was able to run the image in both docker and minikube.
However, I noticed among my build output, the line:
#11 27.20 Warning: The host machine does not support all features of 'x86-64-v3'. Falling back to '-march=compatibility' for best compatibility.
So the architecture of the built image can depend on that of the machine that builds it, at least in this case. My guess is that the above fallback does not happen on the machine that builds the published geoip-api images.
I'll change to build args. Thanks for the find!
Thanks for the PR! Accepted and I re-triggered todays release build. You should be able to use the release in approx. 1h.
The image runs fine for me in docker, with command:
docker run --rm -it ghcr.io/observabilitystack/geoip-api:latest
.However, when I try to run in minikube (kubernetes), with command:
kubectl create deployment --image ghcr.io/observabilitystack/geoip-api:latest geoip-test1
The pod terminates immediately in error, producing only the output:
In a full (non-minikube) kubernetes cluster when trying to run an older (2023-06) image, it terminates immediately with error:
Suggestions online range from those related to the first error, e.g. "change -march=native to -march=x86-64", to running with different versions of libc. Are there any suggested workarounds to, or possible fixes for, the above errors?