-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Add cli build warning about chmod bits on windows #11397
Conversation
@duglin |
// windows: show error message about modified file permissions | ||
if runtime.GOOS == "windows" { | ||
msg := `SECURITY WARNING: You are building a Docker image from Windows against a Linux Docker host. All files and directories added to build context will be set as executable and group/other permissions will be removed. It is recommended to double check permissions for sensitive files and directories.` | ||
log.Warn(msg) |
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.
no need for a variable use the string directly.
@tiborvass fixed your comments. waiting on @duglin's input on failing TestBuildStderr. I'm still not sure writing to stderr is OK in this case. |
I think http://stackoverflow.com/questions/1430956/should-i-output-warnings-to-stderr-or-stdout is a good explanation for why warnings should go to stderr. |
@duglin thanks for taking a look and suggesting to modify the test. I will basically say: if windows, all lines in stderr must begin with |
Yep - something like that should work since all we really care about is that the builder output doesn't show up there. |
@duglin fixed. thanks. |
I'm generally okay with this and agree a message should be printed. |
@ahmetalpbalkan test are failing |
This shows a warning message about adjusted file/directory permission bits when the `docker build` cli command is executed on windows. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
LGTM |
ping @duglin :D |
LGTM |
Add cli build warning about chmod bits on windows
This shows a warning message about adjusted file/directory permission bits
when the
docker build
cli command is executed on windows. This will helpWindows users understand the potential security problems.
We should be revisiting this warning when building against a Windows
docker engine. @jhowardmsft
Example:
Signed-off-by: Ahmet Alp Balkan ahmetalpbalkan@gmail.com
cc: @tianon @tiborvass @ewindisch