Dockerfile安装多个MSI [英] Dockerfile installing multiple msi
问题描述
我想将以下程序作为服务器安装到Windows 10上,因此以后需要安装我的maven字符串启动项目.
I would like install the following programs to the Windows 10 as a server and hence my maven string boot project afterwards.
Git (windows 64 bit) Version: 2.16.2
Java SE Development Kit (windows 64 bit) Version: 8u201
Open JDK (windows 64 bit) Version: 11.0.2
Apache Maven Version: 3.6.1
Eclipse 2019-03 (windows 64 bit) Version: 4.11.0
Lombok Version: 1.18.6
在配置方面,我发现仅安装一个软件即可配置的示例,而不是多个.作为一名开发人员,请告诉我如何为多个msi准备安装步骤,例如可以将上述组件安装在一个DockerFile中吗?
When it comes to the configuration, I find out the samples that only installing one software to configure instead of multiple. As a dev-ops operator, Would you please tell me how to prepare the installation steps for multiple msi such as I can install the above components in one DockerFile?
这是我正在进行的DockerFile工作:
Here is my DockerFile work in-progress :
FROM openjdk:8-jre-alpine
WORKDIR /code
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
推荐答案
您在这方面取得了任何进展吗?您可能需要一些\来表示新行,但是它是同一RUN命令的一部分:
did you make any progress on this? You may need some \ to indicate new line but part of the same RUN command:
运行Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing"
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:\;\
Expand-Archive nodejs.zip -DestinationPath C:\; \
重命名项"C:\ node-v8.11.0-win-x64" c:\ nodejs
Rename-Item "C:\node-v8.11.0-win-x64" c:\nodejs
这篇关于Dockerfile安装多个MSI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!