1 | initial version |
To generate a Docker image by using an internal NuGet package that is reachable through an internal network path, follow these steps:
FROM microsoft/dotnet:2.2-sdk
WORKDIR /app
COPY . .
RUN dotnet tool install --global NuGet.CommandLine
ENV PATH="${PATH}:/root/.dotnet/tools"
nuget
CLI to restore your packages from your internal NuGet feed. For example:RUN nuget sources add -name MyNuGetFeed -source \\server\path\to\feed
RUN nuget restore MyProject.csproj -Source MyNuGetFeed
Continue building your Docker image by adding any additional steps necessary to configure your application and its dependencies.
Build your Docker image using the docker build
command. Make sure you are running the command in a context that has access to your internal network path.
docker build -t my-image .
docker push
command. docker push my-registry/my-image
Overall, the key steps for generating a Docker image using an internal NuGet package that is reachable through an internal network path are to configure your NuGet client, restore your packages from your internal feed, and then continue building your Docker image as usual.