Search code examples
amazon-eksquarkusamazon-ecrjib

standard_init_linux.go:219: exec user process caused: exec format error ECR + Quarkus


Ok, I already know that there are many errors on SO, however I cannot find any that suits with my case.

PREMISE:

My environments is MacOS with M1.

I have an EKS cluster with linux (amd64) as OS architecture on AWS.

When trying to build and deploy my micro service with Quarkus, I set on application.properties:

quarkus.container-image.image=<my ECR repository>
quarkus.container-image.build=true
quarkus.container-image.push=true
quarkus.jib.platforms=linux/amd64

I'm using jib extension for building image.

Once the image is succesfully deployed on my ECR aws registry, I launch:

 kubectl apply -f target/kubernetes/kubernetes.yaml

then

 kubectl get po

I see

NAME                              READY   STATUS             RESTARTS   AGE
kube-cm-example-6ffd58655-rzzqh   0/1     CrashLoopBackOff   8          16m

Then

kubectl logs kube-cm-example-6ffd58655-rzzqh

return the following output

standard_init_linux.go:219: exec user process caused: exec format error

I read on many sources it's a platform image issue, however using jib I set linux/amd64 which is the same arch of the node.

I also tried to manually build a docker image specifying platform=linux/amd64 and then deploying to ECR, but nothing changes.


Solution

  • Based on the observations, it may be that your Kubernetes cluster is not pulling newly updated images from ECR when starting a pod. Unless some conditions are met, the default pull policy of k8s skips pulling images if they already exist. During development, you may consider making it always pull images. Take a look at this Stack Overflow question.