【发布时间】:2018-01-04 18:02:49
【问题描述】:
我在 asp.net-core 2.0 preview1 中开发了应用程序。 我使用 Visual Studio 2017 在 Windows 上开发。
现在我想使用 Docker 将它部署到 Linux 服务器。
我创建了 Docker 文件:
FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
EXPOSE 44305
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "Aplication.dll"]
之后运行命令:
dotnet build -o obj/Docker/publish -c Release
dotnet publish -o obj/Docker/publish -c Release
docker build -t testapi-api .
docker run -p 44305:80 --name api testapi-api
在最后一个命令run 之后我收到下一个错误:
An assembly specified in the application dependencies manifest (Aplication.deps.json) was not found:
package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.0-preview1-final'
path: 'lib/netcoreapp2.0/Microsoft.AspNetCore.Antiforgery.dll'
This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
manifest.win7-x64.xml;manifest.win7-x86.xml;manifest.osx-x64.xml;manifest.linux-x64.xml
我是 asp.net-core 的新手,尤其是 Docker。所以这方面的任何帮助都很棒。
【问题讨论】:
-
您尝试过 dotnet restore 吗?
-
是的,我试过了,但还是一样的错误
标签: c# docker asp.net-core dockerfile