面临在Docker上工作的ServiceStack自托pipeF#示例的挑战

我使用Visual Studio 2013和ServiceStackVS创build了ServiceStack F#项目。 然后,我使用F#创build了“ServiceStack自托pipe空”项目。 有用。

然而,在用Docker“容器化”它并试图在boot2docker下运行它之后,我无法得到这个项目的工作。 在Windows机器上运行的VirtualBoxconfiguration中有一个久经考验的boot2docker。 SSH到boot2docker中,使用共享文件夹从boot2docker中访问Windows文件系统。 Dockerfile成功build立:

Dockerfile:

FROM mono:3.10 RUN apt-get -qq update && apt-get -qqy install unzip socat ADD . /var/www/ WORKDIR /var/www/ RUN nuget install SelfHost03/SelfHost03/packages.config -o packages RUN xbuild SelfHost03.sln EXPOSE 8080 CMD /usr/bin/socat -s EXEC:"mono SelfHost03/SelfHost03/bin/Debug/SelfHost03.exe",ignoreeof -,ignoreeof 

也试过了:

 ENTRYPOINT ["mono","SelfHost03/SelfHost03/bin/Debug/SelfHost03.exe"] 

但是,当我尝试运行容器时,我收到以下内容:

ServiceStack SelfHost listening at http://localhost:8080

未处理的exception:System.ComponentModel.Win32Exception:在System.Diagnostics.Process.Start_shell(System.Diagnostics.ProcessStartInfo startInfo,System.Diagnostics.Process过程)中找不到指定的文件:0x0 0000在:System.Diagnostics.Process .Start_common(System.Diagnostics.ProcessStartInfo startInfo,System.Diagnostics.Process进程)在[0x00000] in:System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo startInfo)中的位置为0:System.Diagnostics System.ComponentModel.Win32Exception:System.ComponentModel.Win32Exception:.Process.Start(System.String fileName)[0x00000] in:0在SelfHost03.Main.main(System.String [] argv)[0x00000] in:0 [错误]致命未处理EXCEPTION:System.ComponentModel.Win32Exception:Can not在System.Diagnostics.Process.Start_common(System.Diagnostics.ProcessStartInfo startInfo,System.Diagnostics.Process.Start)中find指定的文件(System.Diagnostics.ProcessStartInfo startInfo,System.Diagnostics.Process进程)[0x0 0000] System.Diagnostics.Process进程)[0x 00000 ] in:0在System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo startInfo)[0x00000] in:0在System.Diagnostics.Process.Start(System.String文件名)[0x00000] in:0在SelfHost03.Main .main(System.String [] argv)[0x00000] in:0

花了一些时间,这是由于我不熟悉F#的结果,但问题出现在添加/包含:

 Process.Start("http://localhost:8080/") |> ignore 

使用更新模板重新创buildC#项目包括等效项:

 Process.Start("http://localhost:8080/"); 

删除这些语句后,项目将继续在Windows上运行,派生的Docker镜像/容器也将工作。