应用程序只是不会在容器中运行 [英] App(s) just wont run in container

查看:92
本文介绍了应用程序只是不会在容器中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一台运行Windows Docker的Win 10机器。

Got a Win 10 machine running windows docker.

我有两个应用程序,我一直试图在过去12小时内进行停靠。两者都不会在容器中正确运行。

I have two apps that I've been trying to dockerize for the last 12 hours. Neither will run correctly in the container.

我正在使用windowsservercore基本映像。我不能使用nanoserver,因为应用程序是32位。

I'm using windowsservercore base image. I cant use nanoserver as apps are 32Bit.

它实际上是供应商Windows服务的第一个应用程序。作为测试,我可以站起来,安装服务,它按预期工作。但是如果我在docker容器中执行完全相同的过程,则该过程开始,但它不会打开它的端口或开始它的
读取/写入它的工作文件夹。不会抛出任何错误,并且事件日志中不会显示任何内容。当试图停止服务时,它不会,这也表明进程没有完全或正常启动。

The first app it actually a vendor windows service. As a test, I can stand up a VM, install the service and it works as expected. But If I do the exact same process in a docker container, the process starts, but It does not open its port or commence it's read/write to it's working folder. No errors are thrown, and nothing appears in the event logs. When trying to stop the service, it wont, which also indicates the process has not started completely or properly.

第二个应用程序是一个带有COM Interop的.NET应用程序。字面上我的代码4行,运行供应商COM组件,没什么复杂的。同样的故事在这里在普通主机或VM上运行它没有问题。将它安装到docker容器,我得到一个COM Exception" A尝试评估查询字符串时出现
语法错误(来自HRESULT的异常:0x80040203)"。我可以通过删除Interop期望与.exe一起使用的原生.dll来在任何计算机(VM或主机)上重新发出此错误。我有三个
确认这个.dll与容器中的.exe一起出现。它只是忽略了搜索它。甚至,将.dll复制到容器的每个文件夹中,希望淹没路径,但没有。

The second app it a .NET app with COM Interop. Literally 4 lines of my code, to run vendor COM component, nothing complex. Same story here. Run it on a normal host or a VM and no issues. Install it to the docker container, and I get a COM Exception "A syntax error occurred trying to evaluate a query string (Exception from HRESULT: 0x80040203)". I can repo this error on any machine (VM or host) by removing an accompanying native .dll that the Interop is expecting to be with the .exe. I have tripple confirmed this .dll is present with the .exe in the container. It just simply ignores searching for it. Even, copied the .dll to every folder of the container hoping to fluke a path, but no.

我已经尝试过所有用户使用太阳来使应用程序工作,但完全没有想法。

我只能假设windowsservercore缺少普通虚拟机实例不存在的东西。

没有任何体面的错误,我该怎么办?甚至开始孤立为什么这些进程无法在容器中运行?似乎没有办法做到这一点?

我甚至无法看到如何运行一些诊断工具,如进程监视器,因为没有GUI?

如果您有任何随意的想法,我很乐意听到它们,任何事情都值得一试。

推荐答案

这是一个有点邪恶的过程,但我已经破解了它。

Was a slightly evil process but I've cracked it.

我必须在工作中运行procmon机器并捕获应用程序正在访问的所有文件。然后将所有这些文件导出到文本文件。

I had to run procmon on a working machine and capture all the files that were being accessed by the application. Then export all of these file to a text file.

然后使用在容器上运行的powershell脚本,检查procmon捕获的每个文件是否存在。

Then using a powershell script running on the container, check for the existance of each of the files captured by procmon.

对于容器中没有的任何文件,将它们从主机复制到容器中,并将它们放在应该存放的文件夹中。

For any files not present in the container, copy them from the host to the container and put them in the folder where they should be.

在我的情况下我只是必须上传c:\windows \ syswow64目录中缺少的2个.dll。现在情况正常。

In my case I just had to upload 2 .dll's that were missing from the c:\windows\syswow64 directory. And now things work.

我希望这有助于其他人。

I hope this helps someone else.


这篇关于应用程序只是不会在容器中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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