Answers: <p>It is not currently possible to disable that warning, see discussions on <a href="https://github.com/moby/moby/issues/20397" rel="noreferrer">Issue 20397</a>:</p>
  
  <blockquote>
    <p>That warning was added, because the Windows filesystem does not have
    an option to mark a file as 'executable'. Building a linux image from
    a Windows machine would therefore break the image if a file has to be
    marked executable.</p>
    
    <p>For that reason, files are marked executable by default when building
    from a windows client; the warning is there so that you are notified
    of that, and (if needed), modify the Dockerfile to change/remove the
    executable bit afterwards.</p>
  </blockquote>
  
  <p>In a sense this also means it's practically impossible to actually solve the issue.</p>
  
  <p>What maybe can help a bit is moving the error message from stderr to stdout, released in docker 17.04. See <a href="https://github.com/moby/moby/pull/29856" rel="noreferrer">Issue 29856</a>.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-08-11T02:05:12.443Z
Answers: 2017-08-11T02:05:12.443Z
Answers: Dan Cornilescu
Body: <p>When a docker image is built on a Windows host the following message is returned:</p>
  
  <pre><code>SECURITY WARNING: You are building a Docker image from Windows against a non-Windows
  Docker host. All files and directories added to build context will have '-rwxr-xr-x'
  permissions. It is recommended to double check and reset permissions for sensitive files 
  and directories.
  </code></pre>
  
Tags: <docker><windows>
Title: What are best practices to solve `All files/directories will have '-rwxr-xr-x' permissions` when building docker images on Windows?
UserDisplayName: 030
ThreadText: # What are best practices to solve `All files/directories will have '-rwxr-xr-x' permissions` when building docker images on Windows?
  
  (Asked by: username_0 on 2017-08-06)
  
  When a docker image is built on a Windows host the following message is returned:
  
  ```
  SECURITY WARNING: You are building a Docker image from Windows against a non-Windows
  Docker host. All files and directories added to build context will have '-rwxr-xr-x'
  permissions. It is recommended to double check and reset permissions for sensitive files 
  and directories.
  
  ```
  
  **Tags:** docker, windows
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-08-11. Score: 5 | Accepted answer
  
  It is not currently possible to disable that warning, see discussions on [Issue 20397](https://github.com/moby/moby/issues/20397):
  
  > That warning was added, because the Windows filesystem does not have
  > an option to mark a file as 'executable'. Building a linux image from
  > a Windows machine would therefore break the image if a file has to be
  > marked executable.
  >
  > For that reason, files are marked executable by default when building
  > from a windows client; the warning is there so that you are notified
  > of that, and (if needed), modify the Dockerfile to change/remove the
  > executable bit afterwards.
  
  In a sense this also means it's practically impossible to actually solve the issue.
  
  What maybe can help a bit is moving the error message from stderr to stdout, released in docker 17.04. See [Issue 29856](https://github.com/moby/moby/pull/29856).
  
  
  ---
  
  