Windows: Fix COPY file . after WORKDIR#27884
Conversation
|
cc @johnstep |
|
That's great to have the same experience on both platforms. Seems to have an issue with |
Signed-off-by: John Howard <[email protected]>
7a168bf to
f0b93b6
Compare
|
Fixed. |
| func (s *DockerSuite) TestBuildWindowsAddCopyPathProcessing(c *check.C) { | ||
| testRequires(c, DaemonIsWindows) | ||
| name := "testbuildwindowsaddcopypathprocessing" | ||
| // TODO Windows (@jhowardmsft). Needs a follow-up PR to 22181 to |
There was a problem hiding this comment.
Is this To Done? Somewhere else?
There was a problem hiding this comment.
Still todo. Nothing to do with this PR.
|
I applied the patch and ran a test that works on Linux (changing With this patch, building still fails on Windows but with a different error:
Before this patch, the error was:
|
|
|
|
isn't |
|
|
Good point, yes, it can be relative. But it's working for me on master which contains this patch: |
|
It works if I add the backtick escape directive: |
|
@jhowardmsft Has there been discussion on changing the default escape character for Windows? Unfortunately, without versioning, I guess that would break many existing Dockerfiles. |
|
Yes, discussed significantly in the PR to introduce it. There were many reasons to keep the default as |
|
@johnstep Works for me (as it should do here as there's no / \ ambiguity in this Dockerfile) regardless of the parser directive. Here's without (again running master): |
|
It worked fine when I rebuilt with |
Signed-off-by: John Howard [email protected]
Fixes #27545. @duglin @thaJeztah @friism
This fixes the last of the problems reported in the above issue, specifically on Windows where
COPY somefile .after aWORKDIRstatement where the workdir does not previously exist in the image, copied the contents ofsomefileto a filename of the WORKDIR, rather than a file in the folder of the WORKDIR. This change makes the builder on Windows consistent with Linux. Test case added too.(Another fix for the overall issue from @duglin at #27873)
@MichaelSimons @StefanScherer FYI