Docker Community Forums

Share and learn in the Docker community.

Dotnet restore from both public and private repo failing

I have a dockerfile that is copying my nuget.config file and running a dotnet restore. However, the dotnet restore seems to only be attempting to pull from the private repo which obviously doesnt work since I am not hosting the entirety of .net core packages on my private repo.

I have both the public and private repo in my nuget.config file.

Does anyone have a solution for this?

Relevant dockerfile lines

COPY NuGet.Config ./

RUN dotnet restore “MyProjFolder/MyProj.csproj” --configfile NuGet.Config

Try
RUN dotnet restore “MyProjFolder/MyProj.csproj” --configfile “MyProjFolder/NuGet.Config"