Docker Container fail to run the spring native executable built using GraalVM

588 Views Asked by At

I have built a simple REST API using springboot3 and graalVM runtime. I am trying to dockerize the same app and run locally. But upon running the container I get error
exec /app: exec format error. I am using mac M1 and trying to run docker container locally.

This is my Dockerfile

#FROM container-registry.oracle.com/os/oraclelinux:8-slim
#FROM scratch
FROM gcr.io/distroless/base

EXPOSE 8080
COPY build/native/nativeCompile/nativeimage app
ENTRYPOINT ["/app"]

Docker image inspection

 "Architecture": "arm64",
        "Os": "linux",

I could run my native executable but expecting to be run as a docker container too. I am using gradle build too hence finding it difficult how to build native image inside a container?

0

There are 0 best solutions below