-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Translate Windows-Style path in volume mounting #5458
Translate Windows-Style path in volume mounting #5458
Conversation
Hi @Elegie thanks for the PR. Concerning Linux, we have the setup in our CI which should cover that and since your PR is green we should be safe for Linux. I also won't worry much for Mac, but I will take the liberty to verify it myself later on today. @stuartwdouglas @jaikiran @gsmet @rsvoboda @maxandersen @cescoffier I do not have a Windows machine, can we get someone with a |
@machi1990 isn't the issue here on the old legacy docker for windows ? I've not seen any issues like this on the new/current docker desktop... |
Hi @maxandersen thanks for having a look at this one. Yes the issue being fixed is for the Docker Toolbox . We'll have to check that the PR actually fixes the issue for the toolbox and verify that we have not regressed the working Docker Desktop for Windows version. Anything else you would like checking? @Elegie I am checking on MacOs now. |
Hi @machi1990 @maxandersen. I think just building the native image with the maven plugin is fine. I'm sorry I couldn't do it myself, I just don't own the appropriate environments. |
@@ -82,7 +83,7 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa | |||
// E.g. "/usr/bin/docker run -v {{PROJECT_DIR}}:/project --rm quarkus/graalvm-native-image" | |||
nativeImage = new ArrayList<>(); | |||
Collections.addAll(nativeImage, containerRuntime, "run", "-v", | |||
outputDir.toAbsolutePath() + ":/project:z"); | |||
FileUtil.translateToUnixStyle(outputDir.toAbsolutePath().toString()) + ":/project:z"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be more comfortable if we only did that for Windows, considering we already have platform specific tests below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 doing so we can remove this condition https://github.com/quarkusio/quarkus/pull/5458/files#diff-fa19c024de216cdbcfde070394b65459R71
So I compared the two |
Hello @machi1990, the Windows system I had borrowed from a friend for testing doesn't have docker installed. So I may not be able to test this out. In general, I agree with what you and @gsmet suggested - making this change only applicable for Windows, so as to reduce the chances of this having any adverse affect on other operating systems. |
Okay thanks for the update. |
Hi, thank you for the review. I have pushed the two requested changes in a new commit, after rebasing the branch on the upstream:
I have updated the naming and documentation to reflect the semantics change implied by the "/" condition removal as well. Do you know if the current plugin actually work on Windows with "Docker for Windows"? If so, what kind of path would be displayed by the console in the volume-mounting part? Besides protecting Unix/Mac, the "/" condition was also a bit of an incantation trying to address this. |
…rks in legacy Docker Toolbox.
I just rebased, squashed and force pushed. |
Merged, thanks! |
Thanks for the discussions, review and merge! |
@jaikiran , @machi1990 , @Elegie : I am getting related issue with "docker for windows" and not able escape through this. Not sure if this is tested but do i need to downgrade docker for windows to some lower version? if yes, then what should it be? Current Version is 2.1 and 19.3 engine. |
Rationale
There are two distributions of Docker which can be installed on Windows: the legacy "Docker Toolbox", which runs on Virtualbox, and the more recent "Docker for Windows", which runs on Hyper-V.
The mounting of volumes on the legacy Docker Toolbox requires a certain formatting of windows paths. This PR provides the required path translation.
I could only test on Windows 10 Home Edition, with the Docker Toolbox. I have not made any regression testing on Windows 10 with Docker For Windows, nor Mac or Linux, as I don't own any machine with these environments.
Note that the build still reports an error on the assembly, which seems of no consequence:
[ERROR] OS=Windows and the assembly descriptor contains a *nix-specific root-relative-reference (starting with slash) /
See #5360
Tested locally (Windows 10 Home Edition, with Docker Toolbox).
Install the new plugin:
mvn install
Create a sample projet:
mvn archetype:generate -DarchetypeGroupId=io.quarkus -DarchetypeArtifactId=quarkus-amazon-lambda-archetype -DarchetypeVersion=1.0.0.CR1
Update the pom.xml of the project:
<quarkus.version>999-SNAPSHOT</quarkus.version>
Start the Docker Machine (legacy Docker Toolbox):
docker-machine start
Build:
mvn clean package -Dnative=true -Dnative-image.docker-build=true
Native Build log provided below. There's an error reported by the assembly, but seemingly not relevant.
Deploy locally (based on https://github.com/quarkusio/quarkus/pull/5377/files):
sam local invoke --template sam.native.yml --event payload.json
Native Build log
sam.native.yml
Local Invocation log