I am trying to configure a container to run my build. (It is a windows core container.)
When I run a nuget command in the docker file, it fails. But when I connect powershell to the container, it runs fine.
This is the command in question:
nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/Common
I run it from the docker file like this:
RUN nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/Common
And get the following error:
sources: invalid arguments.
However, when I take the container and start it using:
docker run -it agent:v1
Then run the same command inside the container:
nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/Common
The result is:
Package Source with Name: Common added successfully.
What would cause it to fail in the dockerfile and not in the container?
Note:
In case it is useful, here is my full docker file:
FROM sixeyed/msbuild:netfx-4.5.2-webdeploy AS build-agent
SHELL ["powershell"]
RUN nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/Common