Search code examples
dockerquarkusquarkus-native

Quarkus native executable built on Windows not running inside a Docker container


First, I build a Quarkus native image, everything seems to be fine. When I try to run it, I get the following error:

standard_init_linux.go:228: exec user process caused: no such file or directory

This is the Dockerfile:

FROM alpine:3.15

WORKDIR /deployment/

COPY native/*-runner /deployment/app

RUN chmod 775 /deployment

EXPOSE 8082
USER 1001

ENTRYPOINT [ "./app","-Dquarkus.http.host=0.0.0.0"]

I'm on a Windows machine and the command used to generate the native executable (the *-runner file) is:

mvn package -Pnative -Dquarkus.package.type=native -Dquarkus.native.container-build=true

I'm not sure what I'm doing wrong, after browsing similar issues, some were solved with the -Dquarkus.native.container-build=true flag, but it didn't work in my case. Thank you !


Solution

  • The problem was in the Dockerfile, I was using alpine:3.15 as base image.

    After reading the guide again, this fixed the problem:

    FROM quay.io/quarkus/quarkus-micro-image:1.0