我有一个.NET Core Console应用程序,试图在Docker映像中托管。默认Dockerfile对我不起作用,因为VSTS无法运行Dockerfile并从私有存储库中检索NuGet软件包。因此,我希望首先编译我的项目。然后,将文件从./bin/Release目录复制到Docker映像中。但是,这时,我收到错误消息:
failed to build: COPY failed: no source files were specified
我的解决方案和项目的目录如下:
MySolution
MyProject
bin
Release
netcoreapp2.1
Dockerfile
Program.cs
MyProject.csproj
.dockerignore
docker-compose.dcproj
docker-compose.override.yml
docker-compose.yml
MySolution.sln
README.md
我的Dockerfile看起来像这样:
FROM microsoft/dotnet:2.1-runtime AS base
WORKDIR /app
ENV myVariable 12345
COPY ./bin/Release/netcoreapp2.1/* /app
我不明白为什么会收到错误no source files were specified
。我可以在bin/Release/netcoreapp2.1
目录中看到它们。我想念什么?
答案 0 :(得分:0)
替换
COPY ./bin/Release/netcoreapp2.1/* /app
使用
COPY ./bin/Release/netcoreapp2.1/. /app/