是否有可能在Docker容器中运行Kinect V2?

我正在探索在Docker for Windows容器中运行C#Kinect Visual Gesture程序(类似于Continuous Gesture Basics项目https://github.com/angelaHillier/ContinuousGestureBasics-WPF)的可行性。

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

  2. 如果答案是肯定的,这里有一些额外的细节:

我使用微软/ dotnet框架:4.7图像作为基础,我的初始Dockerfile如下所示:

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

build立图像:

 $ 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] 。

安装程序有一个EULA,根据一些聪明的威斯康星大学的人 ,有一种技术来提取安装程序使用WIX的dark.exe反编译器( https://social.msdn.microsoft.com/Forums/en-US/a5b04520- e437-48e3-ba22-e2cdb46b4d62 / silent-install-installation-instructions?forum = kinectsdk )

恩。

 $ & 'C:\Program Files (x86)\WiX Toolset v3.11\bin\dark.exe' C:\installerwork\KinectRuntime-v2.0_1409-Setup.exe -xc:\installerwork\kinect_sdk_installersfiles 

我遇到底层msi文件时遇到的问题是没有选项使用msiexec静默运行它们。

我发现从Kinect v2 SDK中提取的运行时安装程序(运行时安装程序(KinectRuntime-x64.msi))至less会在文件系统中进行以下更改:

在C:\ Windows \ System32中创build一个文件夹“Kinect”,并将3个文件添加到System 32中:

k4wcll.dll

kinect20.dll

microsoft._kinect.dll

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

手动复制这些更改不会导致主机上的成功,更不用说在容器中。

目前还不清楚安装程序正在发生哪些其他registry/系统更改(以及是否会让我们通过Docker容器中的目标行)

关于如何从这里出发的任何想法?

总之没有。 在Windows上的泊坞窗没有硬件隧道/地图的能力。 在Linux上,它通过--device=选项来完成

正如@VonC所说,你将需要使用Windows VM,这可能是Hyper-V,或者你可以使用Virtual Box,然后你可以通过隧道方法(添加/连接设备)提供Kinect硬件,没有这个就没有办法为你的容器是虚拟机还是不能访问主机的硬件的窗口。

另一种方法是尝试在Windows服务器虚拟机中安装Kinetic,并检测所述安装带来的确切变化。

请参阅“ 如何找出程序的安装程序进行了哪些修改? ”以及ZSoft Uninstaller 2.5等工具。

一旦确定安装过程影响了哪些文件/registry/variables,可以将其复制到Dockerfile中。