我为.net核心控制台应用制作了一个docker文件:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
LABEL author="some name"
LABEL description="some description"
ENTRYPOINT [ "dotnet", "L1_1_Console.dll" ]
并从中创建了一个名为“ labo1_1_console_image”的图像
当我尝试使用此命令运行此图像时:
docker run --rm -it labo1_1_console_image
我收到此错误:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-L1_1_Console.dll does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
我认为问题是第二个问题(我不确定),但我不知道如何解决此问题,我的L1_1_Console.dll文件分别对应于docker文件位置/bin/Release/netcoreapp3.1(我在这里也有一个发布文件夹使用相同的文件)
将您的Dockerfile更改为
入口点只能看到docker映像中的文件(除非安装了外部卷),因此您需要在运行该映像之前手动将dll文件添加到该映像。