Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native image build gets stuck #16225

Closed
mutasemhidmi opened this issue Apr 3, 2021 · 34 comments
Closed

native image build gets stuck #16225

mutasemhidmi opened this issue Apr 3, 2021 · 34 comments
Labels
area/native-image kind/bug Something isn't working

Comments

@mutasemhidmi
Copy link

native image build gets stuck. I have macbook m1 and I am using docker to build a native image by runninag the below command. Note that I increased the memory in docker desktop and in the pom.xml

./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.native-image-xmx=16g

@vietk
Copy link
Contributor

vietk commented Apr 3, 2021

Hello, you can try to use RemoveSaturatedTypeFlows option to your build, you'll need less memory and probably needs less GC.

@mutasemhidmi
Copy link
Author

@machi1990 [INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:1.11.3.Final:generate-code (default) @ code-with-quarkus ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- quarkus-maven-plugin:1.11.3.Final:generate-code-tests (default) @ code-with-quarkus ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ code-with-quarkus ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.lambda.LambdaHandlerTest
2021-04-03 18:19:00,515 INFO [io.quarkus] (main) Quarkus 1.11.3.Final on JVM started in 3.006s.
2021-04-03 18:19:00,537 INFO [io.quarkus] (main) Profile test activated.
2021-04-03 18:19:00,538 INFO [io.quarkus] (main) Installed features: [amazon-lambda, cdi]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.593 s - in org.acme.lambda.LambdaHandlerTest
2021-04-03 18:19:00,740 INFO [io.quarkus] (main) Quarkus stopped in 0.003s
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ code-with-quarkus ---
[INFO]
[INFO] --- quarkus-maven-plugin:1.11.3.Final:build (default) @ code-with-quarkus ---
[INFO] [org.jboss.threads] JBoss Threads version 3.2.0.Final
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Using docker to run the native image builder
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Checking image status quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11
20.3.1-java11: Pulling from quarkus/ubi-quarkus-native-image
Digest: sha256:9a36053fe4545ab4f20b411a92dd87175d3730d6782a01749160a2610c5f2720
Status: Image is up to date for quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11
quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /Users/mutasemhidmi/Projects/lambda/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /Users/mutasemhidmi/Projects/lambda/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Using docker to run the native image builder
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Checking image status quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11
20.3.1-java11: Pulling from quarkus/ubi-quarkus-native-image
Digest: sha256:9a36053fe4545ab4f20b411a92dd87175d3730d6782a01749160a2610c5f2720
Status: Image is up to date for quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11
quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 20.3.1 (Java Version 11.0.10+8-jvmci-20.3-b09)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] docker run -v /Users/mutasemhidmi/Projects/lambda/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar:/project:z --env LANG=C --rm quay.io/quarkus/ubi-quarkus-native-image:20.3.1-java11 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Duser.language=en -J-Dfile.encoding=UTF-8 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -jar code-with-quarkus-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -J-Xmx16g -H:-AddAllCharsets -H:EnableURLProtocols=http --no-server -H:-UseServiceLoaderFeature -H:+StackTrace code-with-quarkus-1.0.0-SNAPSHOT-runner
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[code-with-quarkus-1.0.0-SNAPSHOT-runner:28] classlist: 12,698.64 ms, 0.96 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:28] (cap): 4,902.28 ms, 0.96 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:28] setup: 15,682.32 ms, 0.96 GB

it gets stuck after that. Note that the image that was used is
REPOSITORY TAG IMAGE ID CREATED SIZE
quay.io/quarkus/ubi-quarkus-native-image 20.3.1-java11 b564d52c4826 6 weeks ago 1.38GB

@mutasemhidmi
Copy link
Author

@vietk what I need to do exactly ?

@vietk
Copy link
Contributor

vietk commented Apr 4, 2021

Sorry for the non detailled answer :
You have to pass the option I mentioned above RemoveSaturatedTypeFlows by using the additional build args commands to the build.

For example, you can modify the native profile in your pom.xml

<profiles>
    <profile>
        <id>native</id>
        <properties>
            <quarkus.package.type>native</quarkus.package.type>
            <quarkus.native.additional-build-args>-H:+RemoveSaturatedTypeFlows</quarkus.native.additional-build-args>
        </properties>
    </profile>
</profiles>

Hope it could helps achieving your build ...

Regards

@mutasemhidmi
Copy link
Author

mutasemhidmi commented Apr 4, 2021

@vietk @machi1990 it didn't work, and I tried to run this command ./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=docker, but It got stuck again. Note that I am using the new MacBook m1.

@mutasemhidmi
Copy link
Author

mutasemhidmi commented Apr 4, 2021

I noticed something weird that although the memory max usage is 16gbyte, the memory usage gets stuck after a while. The below data appears after using the command docker stats.

CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O
f55b6256819d sleepy_perlman 101.21% 1.098GiB / 15.61GiB 7.03% 1.02kB / 0B 0B / 627kB

@jaikiran
Copy link
Member

jaikiran commented Apr 6, 2021

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Note that I am using the new MacBook m1.

I'm not sure if that architecture is currently supported by Graal VM/native-image. It's only recently that the base OpenJDK itself added support for this openjdk/jdk#2200.

@vietk
Copy link
Contributor

vietk commented Apr 6, 2021

The native build is running into a docker container, so as long as docker is supported on M1, it should be working.

@mutasemhidmi
Do you have a large code base to compile natively?
Because, the more complex is the code, the more memory you need to do the compilation ...

Maybe you can add also this option to your build to have more information of the native compilation

-H:+PrintAnalysisStatistics

by updating the native profile :

  <profile>
      <id>native</id>
      <properties>
          <quarkus.package.type>native</quarkus.package.type>
          <quarkus.native.additional-build-args>-H:+RemoveSaturatedTypeFlows,-H:+PrintAnalysisStatistics</quarkus.native.additional-build-args>
      </properties>
  </profile>

@mutasemhidmi
Copy link
Author

@vietk I am just trying quarkus lambda example, the one with greeting class. I wanted to ask something is there any difference between using ./mvnw package -Pnative -Dquarkus.native.container-build=true and ./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=docker. Note that both are giving me the same results, but as I understood the second one does not use GraalVM

@mutasemhidmi
Copy link
Author

Is this a Macbook m1 issue or Quarkus ?

@zakkak
Copy link
Contributor

zakkak commented Apr 12, 2021

I wanted to ask something is there any difference between using ./mvnw package -Pnative -Dquarkus.native.container-build=true and ./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=docker. Note that both are giving me the same results, but as I understood the second one does not use GraalVM

No, both commands will do exactly the same. quarkus.native.container-runtime is used to specify the container engine/runtime and in most cases is not required since Quarkus automatically detects the right engine (docker in your case).

@mutasemhidmi
Copy link
Author

mutasemhidmi commented Apr 13, 2021

I think the problem is coming from the fact that this image is for linux/amd64 and not arm64. I built a graalvm arm64 docker image using https://github.com/graalvm/container/tree/master/community. Now, the build doesn't get stuck, but when I run sam local invoke for my lambda, I get the below error.

msg="Init failed" InvokeID= error="fork/exec /var/task/bootstrap: no such file or directory"

Note that I unzipped function.zip, and I found the bootstrap file there.

@suzihao
Copy link

suzihao commented Apr 22, 2021

I use m1 macbook air,encountered the same problem as you.but I use windows build native image with docker successed. Even the
docker for m1 official version is like this.

@mutasemhidmi
Copy link
Author

@suzihao any idea where is the problem coming from? At first, I thought that it's coming from the image because its type is amd64.

@suzihao
Copy link

suzihao commented Apr 22, 2021

@suzihao any idea where is the problem coming from? At first, I thought that it's coming from the image because its type is amd64.
@mutasemhidmi Completely clueless,I had to use the windows

@stachera
Copy link

stachera commented Jun 4, 2021

I'm using a Mac Mini M1 and I have the same error when I try to build native image. I think that it is related with this message:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Shouldn't this image quarkus/ubi-quarkus-native-image be available to linux/arm64/v8?

@Karm
Copy link
Member

Karm commented Dec 7, 2021

Hello @mutasemhidmi, @suzihao
This GH issue is rather convoluted. If the issue is that aarch64 doesn't work for you, the reason is that aarch64 is not supported for Quarkus container builds, only amd64 is.

Furthermore, native builds with Graal are not supported on Darwin (mac) aarch64 oracle/graal#2666. Only Linux aarch64 are supported with both Graal and Mandrel (since mandrel-21.3.0.0-Fina ).

Depending on what your container engine is capable of, it might be the case that your aarch64 Mac host could host an amd64 Linux container, but the question is entirely outside the scope of Quarkus.

@famod I think this should be closed unless clarified.

@knuspertante
Copy link

Hello @mutasemhidmi @suzihao @stachera ,

As a workaround, you can build your own builder-image from graalvm-ce image.

Graalvm-ce images are available for both platforms: linux/amd64 and linux/arm64

Generate a Dockerfile under src/main/docker/Dockerfile.graalbase

FROM ghcr.io/graalvm/graalvm-ce:latest AS build
RUN gu install native-image
WORKDIR /project
VOLUME ["/project"]
ENTRYPOINT ["native-image"]

Build this docker file

docker build -f src/main/docker/Dockerfile.graalbase -t graalbase . 

Add builder-image to application.properties

quarkus.native.builder-image=graalbase

Build executable:

./mvnw clean install -Pnative -Dquarkus.native.container-build=true

Credits goes to Armin Vogt: https://www.youtube.com/watch?v=IYUQ1tCHkNI&ab_channel=ArminVogtcloud-nativeplaylists

@mutasemhidmi
Copy link
Author

@knuspertante I tried the same exact solution before, but the build got stuck also.

@knuspertante
Copy link

@mutasemhidmi which docker installation do you use?

I use Docker Desktop for Apple Silicon
https://docs.docker.com/desktop/mac/apple-silicon/

@marcelomrwin
Copy link

Hello @mutasemhidmi @suzihao @stachera ,

As a workaround, you can build your own builder-image from graalvm-ce image.

Graalvm-ce images are available for both platforms: linux/amd64 and linux/arm64

Generate a Dockerfile under src/main/docker/Dockerfile.graalbase

FROM ghcr.io/graalvm/graalvm-ce:latest AS build
RUN gu install native-image
WORKDIR /project
VOLUME ["/project"]
ENTRYPOINT ["native-image"]

Build this docker file

docker build -f src/main/docker/Dockerfile.graalbase -t graalbase . 

Add builder-image to application.properties

quarkus.native.builder-image=graalbase

Build executable:

./mvnw clean install -Pnative -Dquarkus.native.container-build=true

Credits goes to Armin Vogt: https://www.youtube.com/watch?v=IYUQ1tCHkNI&ab_channel=ArminVogtcloud-nativeplaylists

It works fine for me, thanks

@rumfuddle
Copy link

Works for me as well. I noticed that the AMD64 image on Docker Desktop only used 2 cores while 4 cores were configured for Docker. Using the ARM image and 6 configured cores, it went super fast.

@debu999
Copy link
Contributor

debu999 commented Jan 10, 2022

with recent quarkus kickstrat we get the following docker images which are only for amd64 so we need to change to redhat/ubi-minimal or build a distroless with arm64 libraries

quay.io/quarkus/quarkus-distroless-image - only available for amd64only available for amd64
quay.io/quarkus/quarkus-micro-image - only available for amd64

Rest the solution works fine in my mac mini 16Gb i have 6 cores to docker and 6GB ram so build completes ~ 4-5min.

@Cs4r
Copy link

Cs4r commented Jun 2, 2022

My environment:

MacOS: 12.1 Monterey
Chipset: Apple M1 Pro
Apache-maven version: 3.6.0
Graalvm: graalvm-ce-java17-22.0.0.2

Followed the steps in: #16225 (comment) in order to build the native image.

Then I deployed the lambda in localstack by using serverless: sls deploy --stage local --config serverless.yml

serverless file:

service: my-lambda

package:
  individually: true

plugins:
  - serverless-localstack

custom:
  stage: local
  defaultStage: local
  localstack:
    debug: true
    stages: [ local ]

provider:
  name: aws
  runtime: provided
  region: eu-west-1
  lambdaHashingVersion: 20201221

functions:
  lambda:
    name: my-lambda
    handler: not.used.in.provided.runtime
    package:
      artifact: target/function.zip
    role: arn:aws:iam::${aws:accountId}:role/my-role
    environment:
      DISABLE_SIGNAL_HANDLERS: true

Then when I invoked the lambda in integration tests and got the following error:

{“ErrorType”:“exiterror”,“errorMessage”:“RequestId:blabla error: “fork/exec /var/task/bootstrap: no such file or directory”}

As a fun fact:

I built the native image in an Intel chipset MacBook and copied the generated function.zip in target/ in my M1 MacBook, then deployed the lambda native image using serverless and that way I could run the lambda seamlessly.

@mutasemhidmi have you been able to run the lambda in your M1 MacBook? Did you overcome the problem I specified above?

@kientorefaissal
Copy link

If you are using macOS Catalina and later you may need to remove the quarantine attribute from the bits before you can use them
To do this, run the following:

$ sudo xattr -r -d com.apple.quarantine path/to/graalvm/folder/
Based on Graal commit: https://github.com/oracle/graal/tree/vm-22.1.0

@vavdoshka
Copy link

vavdoshka commented Feb 4, 2023

Please share if anyone has a working solution.

Specifically, my problem is cross-compile build - build amd64 on Apple arm.

I've tried to use the correct image runtime with -Dquarkus.native.container-runtime-options="--platform=linux/amd64" but that results in a hanged build:

mvn clean install -Dnative  -Dquarkus.native.container-build=true -Dmaven.test.skip=true -Dquarkus.native.container-runtime-options="--platform=linux/amd64" quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:22.3-java17

...skipped....

GraalVM Native Image: Generating 'reminder-1.0.0-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                   (79.1s @ 0.30GB)
 Version info: 'GraalVM 22.3.0 Java 17 CE'
 Java version info: '17.0.5+8-jvmci-22.3-b08'
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC
 3 user-specific feature(s)
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.jboss.threads] categories
 - io.quarkus.runtime.graal.ResourcesFeature: Register each line in META-INF/quarkus-native-resources.txt as a resource on Substrate VM

I also checked on of building locally with GraalVM with cross-compile, but Graal does not support this oracle/graal#407

@gmstam
Copy link

gmstam commented Feb 27, 2023

For arm/arm64 platform, change the image version in src/main/docker/Dockerfile.native-micro to "2.0-arm64"
Then, launch:
./mvnw clean package -Pnative -Dquarkus.native.container-build=true -DskipTests

Generate docker image:
docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/getting-started .

Finally, run:
docker run -i --rm -p 8080:8080 quarkus/getting-started

Tested on quarkus-quickstarts/getting-started

@eistropfen
Copy link

Has anyone worked this out or is this still an open issue? I've been trying to build a amd64 native app on my Apple M1 using the following command:
mvn clean package -Pnative -e \ -Dmaven.test.skip=true \ -Dquarkus.native.container-build=true \ -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3.1.0-Final-java17-amd64 \ -Dquarkus.container-image.build=true \ -Dquarkus.container-image.push=true

However, the build gets stuck. How do I build a amd64/linux based native app and docker image on my M1?

Any help would be appreciated!

@xiaodong-xie
Copy link

@eistropfen, I used this config quarkus.docker.buildx.platform=linux/amd64 in application.properties file, and used docker to build the image on my M1 machine, it worked fine. 🙏

@eistropfen
Copy link

@xiaodong-xie thank you for your reply. Are you able to tell me which builder image you are using?

I've added your suggested config (quarkus.docker.buildx.platform=linux/amd64).

  1. Running the build with:
mvn clean package -Pnative -e \
-Dmaven.test.skip=true \
-Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3.1.0-Final-java17

produces an arm64 / aarch64 runner file

  1. Running the build with:
mvn clean package -Pnative -e \
-Dmaven.test.skip=true \
-Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3.1.0-Final-java17-amd64

Prints

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

but then gets stuck in the [1/7] Initializing... phase.

[1/7] Initializing...                                                                                   (85.3s @ 0.58GB)
 Version info: 'GraalVM 22.3.1.0-Final Java 17 Mandrel Distribution'
 Java version info: '17.0.6+10'
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC
 4 user-specific feature(s)
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.jboss.threads] categories
 - io.quarkus.runtime.graal.ResourcesFeature: Register each line in META-INF/quarkus-native-resources.txt as a resource on Substrate VM

@xiaodong-xie
Copy link

@eistropfen, there is no cross compilation for native images yet (based on the discussion of this issue), adding quarkus.docker.buildx.platform=linux/amd64 allows you to build a linux/amd64 docker image.

@MairwunNx
Copy link

I have this problem too on docker desktop under OS Windows 11, building stuck on this lines

 => [build 10/10] RUN ./gradlew build -Dquarkus.package.type=native -x test                                                                                                                                                           261.2s 
 => => #  C compiler: gcc (redhat, x86_64, 8.5.0)                                                                                                                                                                                            
 => => #  Garbage collector: Serial GC                                                                                                                                                                                                       
 => => #  3 user-specific feature(s)                                                                                                                                                                                                        
 => => #  - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions                                                                                                                                          
 => => #  - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase                                                                                                                                  
 => => #  - org.eclipse.angus.activation.nativeimage.AngusActivationFeature 

With this, also CPU used for 100% and disk usage also is 100%.

@MairwunNx
Copy link

Today I fixed the problem, with this configuration:

build.gradle.kts:

quarkus {
    cacheLargeArtifacts.set(true)
}

tasks.quarkusBuild {
    nativeArgs {
        "quarkus.native.container-runtime" to "docker"
        "additional-build-args" to "-H:+RemoveSaturatedTypeFlows,-H:+PrintAnalysisStatistics,J-enable-preview"
    }
}

application.properties

quarkus.docker.buildx.platform=linux/amd64

Dockerfile:

## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3.1-java19 AS build
USER root
RUN microdnf install findutils
COPY --chown=quarkus:quarkus gradlew /code/gradlew
COPY --chown=quarkus:quarkus gradle /code/gradle
COPY --chown=quarkus:quarkus build.gradle.kts /code/
COPY --chown=quarkus:quarkus settings.gradle.kts /code/
COPY --chown=quarkus:quarkus gradle.properties /code/
USER quarkus
WORKDIR /code
COPY src /code/src
RUN ./gradlew build -Dquarkus.package.type=native -Dquarkus.log.level=INFO -x test

## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
COPY --from=build /code/build/*-runner /work/application
RUN chmod 775 /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

But, there are still problems when the build hangs, but this has become much less common.

@zakkak
Copy link
Contributor

zakkak commented Aug 28, 2024

Closing this as it is quite old and convoluted.

Since this issue was opened Quarkus builder images have become multiplatform and now work on aarch64 as well (quarkusio/quarkus-images#195) and GraalVM/Mandrel has improved Apple M support.

Please create a new issue if needed.

@zakkak zakkak closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests