我想在图像下运行的 Docker 容器中运行一个显示“Hello World”的简单应用程序 微软/windowsservercore。
-> 我将我的可执行文件复制到一个容器中,然后提交我的容器以保存状态。 -> 我启动了我的容器并启动了我的可执行文件。
问题我没有输出
C:\>docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:12:48 2018
OS/Arch: windows/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.24)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:21:42 2018
OS/Arch: windows/amd64
Experimental: false
Hello World 代码源
#include <iostream>
int main()
{
std::cout << "Hello World " << "!\n";
}
可执行文件在 Windows 机器上完美运行。
最佳答案
问题是缺少基本的dll,可以引用:https://github.com/docker/for-win/issues/700
您也可以试试 microsoft/aspnetcore。
关于c++ - 将简单的 exe 运行到运行 microsoft/windowsservercore 的 docker 容器中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50877937/