I have a .NET Core Console app that I am trying to host within a Docker image. The default Dockerfile will not work for me because VSTS cannot run the Dockerfile AND retrieve NuGet packages from a private repo. For that reason, I'm looking to compile my project first. Then, copy the files from the ./bin/Release directory into the Docker image. However, at this time, I'm receiving the error message:
failed to build: COPY failed: no source files were specified
The directory of my solution and project look like this:
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
My Dockerfile looks like this:
FROM microsoft/dotnet:2.1-runtime AS base
WORKDIR /app
ENV myVariable 12345
COPY ./bin/Release/netcoreapp2.1/* /app
I don't understand why I'm getting the error no source files were specified
. I can see them in the bin/Release/netcoreapp2.1
directory. What am I missing?
replace
COPY ./bin/Release/netcoreapp2.1/* /app
with
COPY ./bin/Release/netcoreapp2.1/. /app/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.