我构建了一个带有Grapevine的简单REST服务器,它与windows环境完美运行。 现在我想在带有mono的Docker容器中运行.exe(带有Grapevine.dll)。 我的Dockerfile如下所示:
FROM mono:latest
COPY . /boerse
RUN output="$(curl http://169.254.169.254/latest/meta-data/public-hostname)"
CMD [ "mono", "/boerse/Boerse.exe", "$output" ]
当Docker容器启动时,会出现以下错误消息:
Error: System.TypeLoadException: Could not load type 'Grapevine.Interfaces.Server.HttpListener' from assembly 'Grapevine, Version=4.0.0.195, Culture=neutral, PublicKeyToken=null'.
at Boerse.BoersenApplication.Main (System.String[] args) [0x0002f] in <407ced228a394aa7b9fc2fa883a239a9>:0
TypeRef ResolutionScope not yet handled (57) for .ExtendedProtectionSelector in image /boerse/Grapevine.dll
Could not load signature of Grapevine.Interfaces.Server.HttpListener:get_ExtendedProtectionSelectorDelegate due to: Could not resolve type with token 0100003a assembly: type:ExtendedProtectionSelector member:<none>
TypeRef ResolutionScope not yet handled (57) for .ExtendedProtectionSelector in image /boerse/Grapevine.dll
Could not load signature of Grapevine.Interfaces.Server.IHttpListener:get_ExtendedProtectionSelectorDelegate due to: Could not resolve type with token 0100003a assembly: type:ExtendedProtectionSelector member:<none>
将所有需要的DLL复制到容器中。 有谁知道如何在Docker容器中运行Grapevine或者我做错了什么?