Docker build failing with: command returned a non-zero code: 255

Expected behavior

New Docker container to be built

Actual behavior

Container fails to be built with the output:

Step 2 : RUN dir c:\Users\
---> Running in e3416e006143
The command 'cmd /S /C dir c:\Users\' returned a non-zero code: 255


Steps to reproduce the behaviour

  1. Use the guide at to download and install docker on a Windows Server 2016 TP 5 server
  2. Create a dockerfile with the following
# escape=`
FROM windowsservercore
RUN dir c:\
  1. Build the dockerfile
  2. Change path in dir command to something different but valid (e.g. C:\Users)
  3. Try rebuilding dockerfile

I’ve the same problem, I can’t build more than a run step at a time. So I’ve been restarting my server all day long :cry:

I can’t figure what is wrong yet, but I did face this error when windows updates got installed this morning:

I was using these instructions as well :

version 1.12.0
API v 1.24
kernel 14300.1045.amd64fre.rs1_release_svc.160705-1059

I created an issue for this on the github repository: