-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Docker-based build of native images fails using Minikube on macOS #16040
Comments
/cc @geoand |
@jonathan-meier this look like something that must be fixed as a result of #14635, no? |
From what I can tell, it doesn't seem to be a bug on Quarkus' side, but rather an issue with minikube. As @dmlloyd already stated in #2435 we're using Note also that the escape character in the log message is actually only inserted for the log message itself, meaning the actual command contains the dollar character unescaped: Line 29 in 9e8cf8c
Unfortunately, I neither have any experience with minikube nor a setup to verify my claims. |
A possible workaround might actually be to inject the shell variable |
Sneaky! |
@fkaltner I wasn't able to reproduce it. The containerized native image build worked fine for me in the minikube cluster on macOS ( What is the relevance of the NFS share arguments for Moreover, I did |
@jonathan-meier Yes, you are right, Since it worked on your machine, I carefully re-inspected my local Minikube setup looking for any wrapper scripts for the "docker" command. Actually it turned out I created one (named "docker"), since Minikube does not ship with a local "docker" command:
I guess the The solution was to delete that wrapper script from my local "/usr/local/bin" directory and install docker via Thank you for your help! 👍 For the record (note that I think this only applies if one uses a wrapper script for "docker" with Minikube): The relevance of the NFS share arguments is the
As you correctly noticed docker itself runs in a VM in Minikube. This "docker cp" command is consequently run in the VM, so the path starting with "/Users/..." needs to be present in the VM. For VirtualBox that mount is done automatically but for Hyperkit one has to take care of it manually (see section "Driver mounts" in https://minikube.sigs.k8s.io/docs/handbook/mount/). |
Describe the bug
When running a build of a native image with the quarkus-maven-plugin
NativeImageBuildRunner
fails with:Expected behavior
The build image should be built successfully.
Actual behavior
The build of the image fails since the value of
InitialCollectionPolicy
parameter contains a$
which is not escaped (-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime
) which can be observed in the output ofNativeImageBuildRemoteContainerRunner
:This leads to the following Run Command in the Docker container which is used for the build of the native image:
Obviously the CollectionPolicy cannot be instantiated when the container is run because the reference to its factory method is missing.
To Reproduce
Here's a link to a branch of Eclipse Hono to reproduce the problem: https://github.com/bosch-io/hono/tree/quarkus_native_image_minikube_macos_reproducer
Steps to reproduce the behavior:
/Users
directory into Minikube by defining a NFS share on the host in/etc/exports
(/Users -mapall=<yourname> -network 192.168.64.0 -mask 255.255.255.0
) and start Minikube with--nfs-share "/Users"
and--nfs-shares-root “/“
eval $(minikube docker-env)
mvn clean install -pl '!site' -Pbuild-docker-image,metrics-prometheus,jaeger,build-native-image
Environment (please complete the following information):
Output of
uname -a
orver
Darwin <>-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64 i386 MacBookPro16,1 Darwin
Output of
java -version
GraalVM version (if different from Java)
Quarkus version or git rev
1.13.0.CR1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional context
There's also another PR with the same problem which has been closed due to inactivity: #2435 (review)
The text was updated successfully, but these errors were encountered: