我正在使用nugardt / msbuild泊坞窗映像(windows),但是我需要添加nodejs和gulp,所以我将这个dockerfile打包了
FROM nugardt/msbuild:15.0
RUN powershell -Command \
wget -Uri https://nodejs.org/dist/v10.15.3/node-v10.15.3-x64.msi -OutFile node.msi -UseBasicParsing ; \
Start-Process -FilePath msiexec -ArgumentList /q, /i, node.msi -Wait ; \
Remove-Item -Path node.msi
RUN npm install gulp
问题在于,当它运行时,它会失败并
Step 5/6 : RUN powershell -Command wget -Uri http://104.20.22.46/dist/v10.15.3/node-v10.15.3-x64.msi -OutFile node.msi -UseBasicParsing ; Start-Process -FilePath msiexec -ArgumentList /q, /i, node.msi -Wait ; Remove-Item -Path node.msi
---> Running in 488871f089ff
wget : Unable to connect to the remote server
At line:1 char:1
+ wget -Uri http://104.20.22.46/dist/v10.15.3/node-v10.15.3-x64.msi -Ou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeWebRequestCommand
Remove-Item : Cannot find path 'C:\node.msi' because it does not exist.
At line:1 char:175
+ ... xec -ArgumentList /q, /i, node.msi -Wait ; Remove-Item -Path node.msi
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\node.msi:String) [Remove-Ite
m], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Remov
eItemCommand
我四处张望,找不到任何东西。我已经尝试过
我不确定下一步该怎么做,wget命令在powershell中运行得很好,但是当我执行docker build时,它失败了。
编辑:我将wget换成了ADD,它的工作正常。不知道为什么wget无法连接,但是ADD解决了我的问题。我不会给出答案,因为它不能解决实际的wget问题本身。
ADD https://nodejs.org/dist/v10.15.3/node-v10.15.3-x64.msi .\node.msi