quarkus: Fail to build native function with -Dnative-image.docker-build
Describe the bug
Running mvn package -Pnative -Dnative-image.docker-build=true
on the code generated by quarkus-amazon-lambda-archetype
fails with:
docker: Error response from daemon: invalid volume specification: 'C:\Users\Elegie\springyme_quarkus\lambdatest\target\lambdatest-1.0-SNAPSHOT-native-image-source-jar:/project:z'.
Expected behavior
The packaging works and a function.zip
is available in the target.
Actual behavior The packaging fails with the following:
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Beginning quarkus augmentation
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: C:\Users\Elegie\springyme_quarkus\lambdatest\target\lambdatest-1.0-SNAPSHOT-native-image-source-jar\lambdatest-1.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from C:\Users\Elegie\springyme_quarkus\lambdatest\target\lambdatest-1.0-SNAPSHOT-native-image-source-jar\lambdatest-1.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit Server VM
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] docker run -v C:\Users\Elegie\springyme_quarkus\lambdatest\target\lambdatest-1.0-SNAPSHOT-native-image-source-jar:/project:z --rm quay.io/quarkus/ubi-quarkus-native-image:19.2.1 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar lambdatest-1.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-JNI -H:-UseServiceLoaderFeature -H:+StackTrace lambdatest-1.0-SNAPSHOT-runner
docker: Error response from daemon: invalid volume specification: 'C:\Users\Elegie\springyme_quarkus\lambdatest\target\lambdatest-1.0-SNAPSHOT-native-image-source-jar:/project:z'.
To Reproduce Steps to reproduce the behavior:
mvn archetype:generate -DarchetypeGroupId=io.quarkus -DarchetypeArtifactId=quarkus-amazon-lambda-archetype -DarchetypeVersion=1.0.0.CR1
- Go the app folder, then
mvn package -Pnative -Dnative-image.docker-build=true
.
Environment (please complete the following information):
- Output of
uname -a
orver
: Microsoft Windows [version 10.0.18362.418] - Output of
java -version
: openjdk version “11.0.1” 2018-10-16 OpenJDK Runtime Environment 18.9 (build 11.0.1+13) OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
Additional context
I have Windows Family, which requires me to use the Docker Toolbox. The problem seems to come from the way volumes are defined in the command line, with the Windows format (C:\...\
) being wrong, but unfortunately I have no idea on how to fix it (I’m beginner-level at Docker).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (16 by maintainers)
@Elegie the Amazon Lambda docs have been updated in #5377 to show you how to test local with the SAM CLI which runs in Docker (given your comment about not having an AWS Account)
I use Gradle so have to hand construct the function.zip, so I am curious if this will work for you, and yes also on Mac 😃
Hi @machi1990, thanks for your comment. I’ll be opening a PR by the end of the week then, if that’s alright. Cheers.
Hi again @machi1990. To give you more feedback, I have pulled the sources, made the change, recompiled, ran the tests, installed and tried the updated plugin, and this time it worked and generated a
function.zip
file. I cannot deploy the function to verify whether it works, though (I haven’t properly set up my AWS account yet).Towards the end, the console still prints an error, I don’t know if it is relevant.