title: docker RUN on windows what happens?
body: <p>I struggle to understand what happens when <code>docker build</code> runs on windows.
  Especially the <code>RUN</code> instruction.</p>
  <p>I have seen scripts where after <code>RUN</code> instruction follows powershell code. But in my case I have to use cmd code. Is there a switch? How can I make the <code>RUN</code> run powershell?</p>
  <p><code>RUN [&quot;powershell&quot;, ... </code> causes:</p>
  <p>'[&quot;powershell&quot;' is not recognized as an internal or external command,</p>
  <p>Is there a switch? Configuration? Flag?</p>
  <p>Unfortunatelly the code words are kind of difficult to google due to &quot;run&quot; &quot;command&quot; and similar being kind of really general.</p>
  <p>EDIT: (code in question)</p>
  <pre><code>ARG MINGW32_SCRIPT=install_mingw32.ps1
  ARG MINGW32_INSTALLER=mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip
  ADD ${MINGW32_SCRIPT} ${BASE_PATH}\\${MINGW32_SCRIPT} 
  COPY ${MINGW32_INSTALLER} ${BASE_PATH}\\${MINGW32_INSTALLER}
  
  RUN powershell -command &quot;%BASE_PATH%\%MINGW32_SCRIPT%&quot;
  </code></pre>
  <p>This is what I have now, this works. But the return value of the script is ignored. (As powershell returns sucessfully.)</p>
  <p>I want the last line to be something like:</p>
  <pre><code>RUN ${BASE_PATH}\\${MINGW32_INSTALLER}
  </code></pre>
  <p>I want the build to fail when the script fails. But this fails. (As for some reason after RUN I have to post CMD code. It calls cmd, that calls powershell.</p>
  <p>If it matters, the win is server 2016.</p>
  <p>Thanks for help
  operable program or batch file.</p>