Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Win10 Docker生成:调用WebRequest:无法连接到远程服务器_Windows_Docker_Dockerfile - Fatal编程技术网

Windows Win10 Docker生成:调用WebRequest:无法连接到远程服务器

Windows Win10 Docker生成:调用WebRequest:无法连接到远程服务器,windows,docker,dockerfile,Windows,Docker,Dockerfile,我将在其他windows机器上创建angular web应用程序的docker映像。在执行命令时: docker build -t node . 它给出了以下例外情况: Invoke-WebRequest : Unable to connect to the remote server At line:1 char:73 + ... yContinue'; Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing ht ... +

我将在其他windows机器上创建angular web应用程序的docker映像。在执行命令时:

docker build -t node .
它给出了以下例外情况:

   Invoke-WebRequest : Unable to connect to the remote server
At line:1 char:73
+ ... yContinue'; Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing ht ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt
   pWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
   ll.Commands.InvokeWebRequestCommand

The command 'powershell -Command $ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue'; Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v8.11.0/node-v8.11.0-win-x64.zip"; Expand-Archive nodejs.zip -DestinationPath C:\; Rename-Item "C:\\node-v8.11.0-win-x64" c:\nodejs' returned a non-zero code: 1
您能告诉我如何更正第10行以便提取zip文件吗

这是我的文件

FROM mcr.microsoft.com/windows/servercore:1803 as installer

ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 8.11.0
ENV NODE_SHA256 7b2409605c871a40d60c187bd24f6f6ddf10590df060b7d905ef46b3b3aa7f81

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]
RUN Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v8.11.0/node-v8.11.0-win-x64.zip"; Expand-Archive nodejs.zip -DestinationPath C:\; Rename-Item "C:\\node-v8.11.0-win-x64" c:\nodejs

FROM mcr.microsoft.com/windows/nanoserver:1803

WORKDIR C:\nodejs
COPY --from=installer C:\nodejs\ .
RUN SETX PATH C:\nodejs
RUN npm config set registry https://registry.npmjs.org/

WORKDIR /app

# install and cache app dependencies
COPY src/WebSpa/package.json /app/src/WebSpa/package.json

WORKDIR /app/src/WebSpa
RUN npm install
RUN npm install -g @angular/cli@latest

# add app
COPY . /app

# start app
CMD cd /app/src/WebSpa && ng serve --host 0.0.0.0

不确定这是否有帮助,但我在使用Invoke WebRequest时遇到了类似的问题:无法连接到远程服务器,并通过将代理服务器地址作为参数传递来解决。尝试:


调用WebRequest-OutFile nodejs.zip-UseBasicParsing”“-Proxy

您能告诉我是否必须在一个Dockerfile中安装git和JavaSE开发工具包吗?这是一个问题嗨,你知道chocolate.org吗?这可能会让你的生活轻松很多。我想试试。我不确定你是否可以在一个docker中混合多个,特别是如果他们使用不同的内核。我希望这能有所帮助。我正在尝试为我的客户机创建一个Dockerfile来安装组件