使用Docker在Nano Server中进行Powershell静默安装 [英] Powershell Silent Install in Nano Server with Docker

查看:457
本文介绍了使用Docker在Nano Server中进行Powershell静默安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的docker文件获得一个Nano Server容器,并自动添加Java.

My docker file gets a Nano Server container and it adds Java automatically.

# Get nano server
FROM microsoft/nanoserver

# Download file and set in docker container
ADD http://javadl.oracle.com/webapps/download/AutoDL?BundleId=225355_090f390dda5b47b9b721c7dfaa008135 \ 
    'C:\\java\jre-8u151-windows-x64.exe'

# Silent install and delete install file
RUN powershell Start-Process -filepath C:\java\jre-8u151-windows-x64.exe -ArgumentList '/s,INSTALLDIR=c:\Java\jre1.8.0_151' -Passthru -Wait; \
    Remove-Item C:\\java\jre-8u151-windows-x64.exe -Force

CMD powershell

该过程正常工作,但是在Nano Server中它不会安装任何东西而不会显示任何错误.但是,使用Core Server确实会安装它.

The process works correctly but in Nano Server it does not install anything without showing any error. However, with Core Server it does install it.

静默安装的结果是:

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
              3      476       1464               596   1 jre-8u151-windows-x64

但是,当我用dir命令检查它是否安装时,会看到以下结果:

But then, when I check if it is installed with dir command, I see the following result:

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       12/21/2017  11:04 AM                Program Files
d-----        7/16/2016   2:09 PM                Program Files (x86)
d-r---        11/3/2017   8:44 PM                Users
d-----       12/21/2017  11:05 AM                Windows
-a----        7/24/2017   6:05 PM       65365056 jre-8u151-windows-x64.exe
-a----       11/20/2016  12:32 PM           1894 License.txt

我如何使此过程正常进行?或者我可以使用什么替代方法?

How could I make this process work correctly or what alternative can I use?

推荐答案

Windows nano服务器不支持基于MSI的安装.它支持WSA.请参考:

Windows nano server does not support MSI based installation. It supports WSA. Please refer to:

https://blogs.technet.microsoft.com/nanoserver/2015/11/18/installing-windows-server-apps-on-nano-server/

这篇关于使用Docker在Nano Server中进行Powershell静默安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆