我正在尝试创建基于microsoft/wcf
映像的Windows Docker映像。 WCF服务依赖于从第三方的MSI安装和注册的COM组件。
Dockerfile:
FROM microsoft/wcf
WORKDIR C:/local
COPY SomeInstaller.exe ./
RUN ./SomeInstaller.exe /SP /VERYSILENT /SUPPRESSMSGBOXES /NOICONS
WORKDIR "C:/Program Files/SomeProgram/Interface"
RUN regsvr32 SomeProgramCOM.dll /s
WORKDIR C:/certs
COPY ./ops-certs .
RUN powershell "./Install-OpsCertificates.ps1"
当我在本地Windows 10环境中构建此文件时,它可以正常工作。安装程序成功完成,文件位于正确的位置,并且COM注册通过。但是,当我在构建服务器(Windows Server 2016 1803更新)上运行此程序时,安装程序无法运行(静默失败),并且未注册COM dll。
构建此Dockerfile时输出不应该完全相同吗?
建立输出
Status: Downloaded newer image for microsoft/wcf:latest
---> e4b543a82489
Step 2/9 : WORKDIR C:/local
Removing intermediate container cf6b7d21b207
---> 5e943a9bd1be
Step 3/9 : COPY SomeProgram.exe ./
---> c1e0781fb180
Step 4/9 : RUN ./SomeProgram.exe /SP /VERYSILENT /SUPPRESSMSGBOXES /NOICONS
---> Running in 2cc2bb26cea4
Removing intermediate container 2cc2bb26cea4
---> 1ed4cbf280ad
Step 5/9 : WORKDIR "C:/Program Files/SomeProgram/Interface"
Removing intermediate container 9c5df9cc4cfd
---> 5387093d3311
Step 6/9 : RUN regsvr32 SomeProgramCOM.dll /s
---> Running in 66ddc85117fc
Removing intermediate container 66ddc85117fc
---> 453a43979c71
Step 7/9 : WORKDIR C:/certs
Removing intermediate container 03fefdeb069b
---> a42989c178fb
Step 8/9 : COPY ./ops-certs .
---> 4d60c35a7bab
Step 9/9 : RUN powershell "./Install-OpsCertificates.ps1"
---> Running in 8cecda9be47c
Scrip execution directory is C:\certs
Installing Certificates . . .
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\Root
Thumbprint Subject
---------- -------
8C048578CA1E43CB577C2A64C3AD3101C64FAFC3 CN=MyCompany Root Certificate...
8C048578CA1E43CB577C2A64C3AD3101C64FAFC3 CN=MyCompany Root Certificate...
Import of Root certificate to Root Store Succeeded!!!!!!
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\CA
Thumbprint Subject
---------- -------
8C048578CA1E43CB577C2A64C3AD3101C64FAFC3 CN=MyCompany Root Certificate...
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\Root
Thumbprint Subject
---------- -------
8C048578CA1E43CB577C2A64C3AD3101C64FAFC3 CN=MyCompany Root Certificate...
Import of Root certificate to CA Store Succeeded!!!!!!
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\CA
Thumbprint Subject
---------- -------
22A3E8B4AEC702987A2CBAEDD42573ED97E5BB53 CN=MyCompany Secure Certifica...
22A3E8B4AEC702987A2CBAEDD42573ED97E5BB53 CN=MyCompany Secure Certifica...
Import of Intermediate certificate to CA Store Succeeded!!!!!!
Removing intermediate container 8cecda9be47c
---> 73b2682580ce
Successfully built 73b2682580ce
Successfully tagged local/someprogram:latest
另外,请注意,我确实在Windows服务器上运行SomeProgram的安装程序,并且安装程序正常运行,因此应该没有兼容性问题。