Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
El comando Nuget falla en el archivo docker pero no cuando se ejecuta manualmente

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/Common

Lo ejecuto desde el archivo docker así:

 RUN nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/Common

Y obtener el siguiente error:

 sources: invalid arguments.

Sin embargo, cuando tomo el contenedor y lo comienzo usando:

 docker run -it agent:v1

Luego ejecute el mismo comando dentro del contenedor:

 nuget sources Add -Name "Common Source" -Source http://CompanyPackages/nuget/Common

El 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/Common
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Lo 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
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!