Estoy tratando de configurar un contenedor para ejecutar mi compilación. (Es un contenedor central de Windows).
Cuando ejecuto un comando nuget en el archivo docker, falla. Pero cuando conecto powershell al contenedor, funciona bien.
Este es el comando en cuestión:
nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/CommonLo ejecuto desde el archivo docker así:
RUN nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/CommonY obtener el siguiente error:
sources: invalid arguments.Sin embargo, cuando tomo el contenedor y lo comienzo usando:
docker run -it agent:v1Luego ejecute el mismo comando dentro del contenedor:
nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/CommonEl resultado es:
Package Source with Name: Common added successfully.¿Qué haría que fallara en el dockerfile y no en el contenedor?
Nota:
En caso de que sea útil, aquí está mi archivo docker completo:
FROM sixeyed/msbuild:netfx-4.5.2-webdeploy AS build-agent SHELL ["powershell"] RUN nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/CommonLo probé y conseguí que funcionara así:
Si cambia el contenido de su Dockerfile así:
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"] Y cuando ejecute docker build -t yourImageName .
Terminas con esto:
Sending build context to Docker daemon 2.048kB Step 1/3 : FROM sixeyed/msbuild:netfx-4.5.2-webdeploy AS build-agent ---> 0851a5b495a3 Step 2/3 : SHELL ["powershell"] ---> Running in 10082a1c45f8 Removing intermediate container 10082a1c45f8 ---> c00b912c6a8f Step 3/3 : RUN ["nuget", "sources" , "Add", "-Name", "\"Common Source\"", "-Source" ,"http://CompanyPackages/nuget/common"] ---> Running in 797b6c055928 Package Source with Name: "Common Source" added successfully. Removing intermediate container 797b6c055928 ---> 592db3be9f8b Successfully built 592db3be9f8b Successfully tagged nuget-tester:latest