是否可以在Docker容器内运行Kinect V2



我正在探索运行c#kinect视觉手势程序的可行性(例如,连续手势基础知识项目https://github.com/angelahillier/continuelgesturebasics-wpf)对于Windows容器。

  1. 这甚至是理论上的可能(在Windows容器的Docker中运行C#Kinect?)

  2. 如果对1的答案是肯定的,这里有一些额外的详细信息:

我正在使用Microsoft/dotnet-framework:4.7图像作为基础,我的初始Dockerfile看起来像这样:

FROM microsoft/dotnet-framework:4.7
ADD . /home/gesture
WORKDIR /home/gesture

构建图像:

$ docker build -t kinect .

打开容器:

$ docker run -dit --name kinectContainer kinect

附加到猴子的powershell会话:

$ docker exec -it kinectContainer powershell

当我尝试从Docker容器运行手势应用程序时,我会收到以下错误(这是可以预期的,因为没有安装Kinect SDK):

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependenc
ies. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058) ---> System.BadImageFormatExcep
tion: Cannot load a reference assembly for execution.                                           erable program. Check the spelling of the name, or if a path was included, verify that the path
   --- End of inner exception stack trace ---
   at GestureDetector.GestureDetectorApp..ctor()

在这一点上,最大的问题是如何在容器中安装Kinect V2 SDK [KinectSDK-V2.0_1409-SETUP.EXE]或KINECT V2 RUNTIME [KINECTRUNTIME-V2.0_1409-SETUP.EXE]/p>

安装人员有一个EULA,根据一些聪明的威斯康星大学,有一种技术可以使用wix的dark.exe demompiler(https://social.msdn.microsoft.com/forums/forums/en-en-us en-en-us exe.exe.exe.exe.exe。/A5B04520-E437-48E3-BA22-E2CDB46B4D62/Silent-Install-Installation-Instructions?forum = KinectSDK)

ex。

$ & 'C:Program Files (x86)WiX Toolset v3.11bindark.exe' C:installerworkKinectRuntime-v2.0_1409-Setup.exe -x c:installerworkkinect_sdk_installersfiles

当我到达基础MSI文件时,我遇到的问题没有选择使用MSIEXEC静静地运行它们。

我已经发现,从Kinect V2 SDK提取的运行时安装程序(运行时安装程序(KinectRuntime-X64.MSI))至少在文件系统中进行以下更改:

在C: Windows System32中创建一个文件夹" Kinect",并将3个文件添加到System 32:

k4wcll.dll

kinect20.dll

microsoft._kinect.dll

System32中的最后三个文件应为64位版本(安装程序似乎具有3个版本的x86和x64版本3)

手工复制这些更改不会在主机机器上取得成功,更不用说在容器中。

目前尚不清楚安装程序正在发生哪些其他注册表/系统更改(以及是否会使我们超过Docker容器中的目标线)

关于如何从这里进行的任何想法?

简称。Windows上的Docker无法能够使用硬件隧道/地图。在Linux上,它通过--device=选项

进行操作

正如@vonc所说,您需要使用Windows VM,这可能是Hyper-V,或者您可以使用虚拟框,然后您可以通过隧道方法(add/connect设备)提供Kinect硬件,而没有此功能您的容器无法使用Windows的VM或不访问主机的硬件。

另一种方法是尝试在Windows Server VM中安装动力学,并检测所述安装带来的确切更改。

参见例如"如何找出程序的安装程序进行哪些修改?"以及像Zsoft Uninstaller 2.5一样的工具。

确切确定了安装过程影响哪些文件/注册表/变量,您可以在Dockerfile中复制。

最新更新