无法在Windows上具有SHELL和RUN MKDIR命令的Dockerfile中创建映像

时间:2018-09-12 13:03:40

标签: docker dockerfile

我在Windows 10计算机上使用Docker版本18.03.1-ce。我有以下DOCKERFILE:

FROM microsoft/dotnet:2.1-sdk
# setup powershell options for RUN commands
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference = 'Continue';"]
RUN MKDIR -p "c:\\node"

以上内容引发了如下错误:

 Running in 61c2553fbefd
container 61c2553fbefdbe3f4dabb652f4d39b3761d5124b4ccc97090586bbf4e5e4d0fe encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"CommandLine":"powershell -Command $ErrorActionPreference = 'Stop';$ProgressPreference = 'Continue'; MKDIR -p \"c:\\\\node\"","User":"ContainerUser","WorkingDirectory":"C:\\","Environment":{"ASPNETCORE_URLS":"http://+:80","DOTNET_RUNNING_IN_CONTAINER":"true","DOTNET_USE_POLLING_FILE_WATCHER":"true","NUGET_XMLDOC_MODE":"skip"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}

我尝试删除“ -p”,但仍然遇到相同的问题。有人经历过吗?

0 个答案:

没有答案