-
Hey guys, I need help to understand something. I have a repository with a .NET service and a Dockerfile, and there is a Dockercompose file at the root of the repository. This compose can be run in Visual Studio. This service make use of NuGet packages that are stored in our company Azure DevOps Artifact registry and it need authentication. There is no Nuget.config in the repository, from visual studio we just have setup the nuget feed from the settings and the authentication is done via AD account, so no PAT needed. The docker file is as follow:
Now, with this Dockerfile I can run the docker compose from Visual Studio, image is build and started and everything is working as expected! HOW? I am now trying to update the Dockerfile to use different base images:
With this Dockerfile running the docker compose from VisualStudio is not able to build the image due to missing authentication to the feed, same as from building from CLI. (Kinda expected though). Can someone please explain me what kind of black magic happens in Visual Studio when using the aspnet image? Because you can see both Dockerfile and I do not understand why with one image I can build without authenticating to the feed and the other not. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Assuming your using fast mode, VS is actually building your project outside the context of Docker and just copying the output into the container that will be used for debugging. So in that case, it uses all of VS's authentication abilities for the NuGet feed since the restore happens outside of a container. |
Beta Was this translation helpful? Give feedback.
Assuming your using fast mode, VS is actually building your project outside the context of Docker and just copying the output into the container that will be used for debugging. So in that case, it uses all of VS's authentication abilities for the NuGet feed since the restore happens outside of a container.