Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.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
Node.js Win10 Professional Dockerizing Augular应用程序给出:未知指令:EXPAND-ARCHIVE_Node.js_Angular_Windows_Docker - Fatal编程技术网

Node.js Win10 Professional Dockerizing Augular应用程序给出:未知指令:EXPAND-ARCHIVE

Node.js Win10 Professional Dockerizing Augular应用程序给出:未知指令:EXPAND-ARCHIVE,node.js,angular,windows,docker,Node.js,Angular,Windows,Docker,我将在其他windows机器上创建angular web应用程序的docker映像。在执行命令时: docker build -t node . 它给出了以下例外情况: Error response from daemon: Dockerfile parse error line 10: unknown instruction: EXPAND-ARCHIVE 您能告诉我如何更正第10行以便提取zip文件吗 这是我的文件 FROM mcr.microsoft.com/windows/serve

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

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

Error response from daemon: Dockerfile parse error line 10: unknown instruction: EXPAND-ARCHIVE
您能告诉我如何更正第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

您的Dockerfile运行命令中有一个换行符,导致它不会链接powershell命令,而是尝试将第二个换行符作为Docker命令执行

应该是这样的:

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

您的Dockerfile运行命令中有一个换行符,导致它不会链接powershell命令,而是尝试将第二个换行符作为Docker命令执行

应该是这样的:

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

它运行平稳,执行步骤1、2、3。等等Thanksit运行平稳,执行步骤1、2、3。等等谢谢