dotnet restore to ignore packages
I have several projects in my solution:
The application layer project contains dependencies from an external package source, which I use only with the Worker service.
Now I need to create a docker image for WebAPI, and to do that, I need to call 'dotnet restore' in my Dockerfile.
Is it possible to ignore packages from external package sources if I don't need them in the project I want to build? Because now, to build an image, I need to provide a key for the NuGet source, which I will not use with WebAPI.
- Web API
- Worker service
- Application layer
and many others
The application layer project contains dependencies from an external package source, which I use only with the Worker service.
Now I need to create a docker image for WebAPI, and to do that, I need to call 'dotnet restore' in my Dockerfile.
Is it possible to ignore packages from external package sources if I don't need them in the project I want to build? Because now, to build an image, I need to provide a key for the NuGet source, which I will not use with WebAPI.