【发布时间】:2018-07-26 11:44:57
【问题描述】:
我的 dockerfile 中的入口点有奇怪的问题。
这是我的 dockerfile:
FROM microsoft/dotnet:latest
WORKDIR /test
ADD . /test
RUN ["dotnet", "restore", "DockerAPI2.sln"]
RUN ["dotnet", "build", "DockerAPI2.sln"]
EXPOSE 4000/tcp
ENTRYPOINT [ "dotnet", "DockerAPI2.dll" ]
当我运行 docker run --name test -d -p 4001:4000 -v "C:\Users\random\docker":"/var/lib" -t test-img:latest
我得到下一个错误:
找不到匹配命令“dotnet-DockerAPI2.dll”的可执行文件
我注意到,出于某种 xy 原因,他在 dotnet 和 DockerAPI2.dll 之间放置了“-”,这是无效的。我想知道这是一个错误还是有什么办法可以解决这个问题?
PS:我正在使用 Linux 容器运行 Docker for Windows,并且我在防火墙中启用了 4001。
【问题讨论】:
-
dotnet build …是否创建DockerAPI2.dll在/test中创建,但不是在它的某个子目录中创建?尝试使用绝对完整路径。 -
是的 dotnet build 创建 dll。我已经弄清楚了。它应该包含 dll 的完整路径,因为 dll 不在 /test 文件夹中,而是在 /test/DockerAPI2/bin/Debug/netcoreapp2.0/
标签: .net docker .net-core command-line-interface