Repository navigation
Conversation
|
@jhowardmsft Thank you. So nice! 🐕 and PR |
There was a problem hiding this comment.
why id this deliberately not using logrus? It's used two lines below.
There was a problem hiding this comment.
Because I want it directly in the client output. Let me repro this evening and post up the difference and it will hopefully be obvious.
There was a problem hiding this comment.
@calavera As per this PR:
PS C:\users\Administrator\Documents> docker build -t test .
Skipping '\\?\C:\Users\Administrator\Documents\My Music' - Permission was denied
Skipping '\\?\C:\Users\Administrator\Documents\My Pictures' - Permission was denied
Skipping '\\?\C:\Users\Administrator\Documents\My Videos' - Permission was denied
Sending build context to Docker daemon 4.608 kB
Step 1 : FROM windowsservercore
---> 1757dfa56d73
Step 2 : ENTRYPOINT [ cmd.exe ]
---> Using cache
---> 142a116e6313
Successfully built 142a116e6313
PS C:\users\Administrator\Documents>
Using logrus
PS C:\users\Administrator\Documents> docker build -t test .
time="2016-03-08T18:24:29-08:00" level=error msg="Skipping '\\\\?\\C:\\Users\\Administrator\\Documents\\My Music' - Permission was denied\n"
time="2016-03-08T18:24:29-08:00" level=error msg="Skipping '\\\\?\\C:\\Users\\Administrator\\Documents\\My Pictures' - Permission was denied\n"
time="2016-03-08T18:24:29-08:00" level=error msg="Skipping '\\\\?\\C:\\Users\\Administrator\\Documents\\My Videos' - Permission was denied\n"
Sending build context to Docker daemon 4.608 kB
Step 1 : FROM windowsservercore
---> 1757dfa56d73
Step 2 : ENTRYPOINT [ cmd.exe ]
---> Using cache
---> 142a116e6313
Successfully built 142a116e6313
PS C:\users\Administrator\Documents>
There was a problem hiding this comment.
In other words, same as https://github.com/docker/docker/blob/master/builder/dockerfile/evaluator.go#L109 for the "Step" line.
There was a problem hiding this comment.
Shouldn't "skipping" files be a fatal error? i.e. As a user, I told Docker to build an image from the specified context, but Docker wasn't able to complete that?
There was a problem hiding this comment.
See other comment, but I believe this is the right fix for junctions on Windows.
There was a problem hiding this comment.
except you're sending it to os.Stdout rather than to the output stream configured by the build context, like in the code you pointed. Printing that output should be handled by the caller not by this function.
There was a problem hiding this comment.
Ah yes, you're right. Will fix up.
There was a problem hiding this comment.
OK, removed it. Getting it back to the caller is extremely problematic unless I change the interface to TarWithOptions, which may very likely be called from components outside of the engine. I only added it in the first place (compared with the original PR) to give a little user feedback, but it's really not essential.
|
I'm not sure if this is new: |
|
@icecrime Not related. I'll restart. |
|
With latest docker.exe built from master: And the Docker Client aborts before sending data to the Docker Engine. With this PR: And the Docker image can be built. BTW: @jhowardmsft I have to use |
|
Is there a similar behaviour on Linux if the Client can't read a file/dir/symlink/link/... ? |
|
@StefanScherer yes, for example, if a symlink points to files outside of the build context, the build will fail; e.g. #1676 (and #18789) |
|
@StefanScherer The default wire protocol was switched from TCP to npipe last week. So yes, remove that -H from the daemon. |
|
To be clear, this is not a symlink, but a junction. Similar though. Further, in this case, the PR is catering for a junction which cannot be enumerated due to a shortcoming in golangs handling of long file paths. It's irrelevant whether they are inside or outside the scope as it can't even be enumerated in the first place. Symlinks pointing to outside the build context -will- fail on Windows. |
|
@jhowardmsft I will try that. But what about using Docker with TLS. Can I start the daemon with multiple endpoints for npipe locally + TLS ? I will try that later as well. |
|
Yes re multiple npipe endpoints. I believe they work with TLS, but have not verified myself (I didn't work on the npipe implementation apart from the changes to switch over the default transport). |
Signed-off-by: John Howard <[email protected]>
|
After updating the Example for TLS: :secure
docker daemon -D -b "Virtual Switch" -H npipe:////./pipe/docker_engine -H tcp://0.0.0.0:2376 --tlsverify --tlscacert=%certs%\ca.pem --tlscert=%certs%\server-cert.pem --tlskey=%certs%\server-key.pem |
|
@jhowardmsft oh, sorry, the "follow symlinks outside context" was just an example to show that we fail if files cannot be used in the build context. I still wonder if proceeding the build is the right approach, as the build does not include all the files that the user requested to use in the build context. IMO, failing would give the right signal to the user: "you need to build from a different directory, or fix the unreachable paths, to build your image") Is there a reason we want to continue the build in this situation? |
|
TP4 failure looks genuine. |
|
Actually, it may not be. @jhowardmsft wdyt? |
|
@mlaventure No, that's a known bug in TP4 which frequently hits runs. Not related. |
|
@thaJeztah Obviously there's contention here from your perspective. I don't have a strong opinion either way. If maintainers choose not to take it, that's really your guys decision. I was just fixing a reported issue... |
|
@jhowardmsft I think we should either fix the situation (being able to use those files), or error out and provide a useful error message to the user. Just my 0.02c For the longer term; Do we know where the bug is in Golang? Can we help fixing that bug so that we can fix the actual issue? |
|
I agree with @thaJeztah. Failing fast sounds more ideal and probably more expected. Otherwise, people might find themselves with images lacking files they expect to be there. |
|
At the time I filed the issue #18120 I thought this is windows specific. I tried a similar situation from a Mac building a Linux image with a protected folder and also found out that the Docker client aborts. So it seems writing a Dockerfile in the users's Documents folder is just a bad luck for the user as there are hidden links in it. Solution is to create another directory. I'm happy with anything you decide here. |
|
@StefanScherer thanks. I think this PR is still useful, because we can detect the problem and give a more user-friendly error message ( |
|
🎶 |
|
ping @jhowardmsft :) |
|
ping @jhowardmsft do we need this to improve the error message, but keep the "fail fast" behavior? |
|
Closing. Sounds like this is by design. |
Signed-off-by: John Howard [email protected]
Replacement for #18026, fixes #18120. @StefanScherer