Nuget command fails in docker file but not when run manually
I tried it and got it working like this:
If you change the content of your Dockerfile
like this:
FROM sixeyed/msbuild:netfx-4.5.2-webdeploy AS build-agentSHELL ["powershell"]RUN ["nuget", "sources" , "Add", "-Name", "\"Common Source\"", "-Source" ,"http://CompanyPackages/nuget/common"]
And when you then run docker build -t yourImageName .
You end up with this:
Sending build context to Docker daemon 2.048kBStep 1/3 : FROM sixeyed/msbuild:netfx-4.5.2-webdeploy AS build-agent ---> 0851a5b495a3Step 2/3 : SHELL ["powershell"] ---> Running in 10082a1c45f8Removing intermediate container 10082a1c45f8 ---> c00b912c6a8fStep 3/3 : RUN ["nuget", "sources" , "Add", "-Name", "\"Common Source\"", "-Source" ,"http://CompanyPackages/nuget/common"] ---> Running in 797b6c055928Package Source with Name: "Common Source" added successfully.Removing intermediate container 797b6c055928 ---> 592db3be9f8bSuccessfully built 592db3be9f8bSuccessfully tagged nuget-tester:latest