https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp
Docker command docker build -t aspnetapp
.
I am getting an error for docker bui
I got this resolved on my Windows 10 Machine by Disabling Avast Antivirus and unInstalling McAffee Antivirus.
And you can now run the Docker Build Successfully. I can give Further Assistance if needed.
Just add --network=host
option to docker build
docker build -t aspnetapp . --network=host
Had the same issue, the problem was a missing dependency used by NuGet
.
I am using the microsoft/dotnet:sdk
image, and it works after installing libcurl3
to my image.
Try adding
RUN apt-get update && apt-get install -y libcurl3
to your Dockerfile
before restoring.
if it doesn't work, try restarting your Docker instance.
edit
: if that doesn't help you, there is this open issue on the NuGet github
where some people are trying to solve the same problem.
edit2
:added Ignas solution: restarting docker instance.
If the issue is caused by your organisation's self-signed certificates, you can fix it by:
COPY ["./combined.cer", "/etc/ssl/certs/"]
RUN update-ca-certificates
These steps work for Debian, need to be adapted for other distros.
I had the same issue on Debian 9. I fudge the error with disconnecting from local network. It works for me because I did not change anything on codebase and I do not need to get packages from nuget.
I'm suprised no one said this already. This was caused by not having the latest sdk installed. In my case docker was looking for the file
C:\Program Files\dotnet\sdk\3.1.302\NuGet.targets
However this file did not exist on my machine instead I had a different minor version.
C:\Program Files\dotnet\sdk\3.1.301\NuGet.targets
I'm sure they're away to get it working using an older version, but in my case I just updated the downloaded the latest sdk