Windows docker容器副本';d文件对于生成中的后续步骤不可用
这是我的Dockerfile,由Visual Studio 2019生成。我在Windows docker容器副本';d文件对于生成中的后续步骤不可用,windows,docker,powershell,Windows,Docker,Powershell,这是我的Dockerfile,由Visual Studio 2019生成。我在COPY命令之后添加了一个RUN命令,应该复制的文件不存在 FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 ARG source WORKDIR /inetpub/wwwroot COPY ${source:-obj/Docker/publish} /inetpub/wwwroot RUN powershell
COPY
命令之后添加了一个RUN
命令,应该复制的文件不存在
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} /inetpub/wwwroot
RUN powershell -file "c:\inetpub\wwwroot\Add-Font.ps1" "c:\inetpub\wwwroot\Fonts\OpenSans-Regular.ttf"
如果我删除RUN
命令,它将正常运行,并且我可以在docker终端中运行该命令而不会出现问题。有人能告诉我为什么复制的文件在构建上下文中不存在吗
这是VisualStudio的输出
1> Step 5/7 : RUN powershell -file "c:\inetpub\wwwroot\Add-Font.ps1" "c:\inetpub\wwwroot\Fonts\OpenSans-Regular.ttf"
1> ---> Running in 0cd8d0a14c83
1> [91mThe argument 'c:\inetpub\wwwroot\Add-Font.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.
1> [0mWindows PowerShell
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> Removing intermediate container 0cd8d0a14c83
1> The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; powershell -file "c:\inetpub\wwwroot\Add-Font.ps1" "c:\inetpub\wwwroot\Fonts\OpenSans-Regular.ttf"' returned a non-zero code: 1
1>C:\Users\r103507\Dev\AgSync.DocumentService\RavenSlingshot.DocumentService\Dockerfile : error CTC1014: Docker command failed with exit code 1.
我发现我的问题与几年前报道的这个问题非常相似。所以值得注意的是,我运行的是Windows10 2004