In the Azure DevOps pipeline, create a new secret variable for the PAT. Pass the PAT in the Azure DevOps Pipeline Run the docker build again and it will finish successfully this time. You can find the finished Dockerfile on GitHub. To use the nfig file during the restore, use the –configfile flag and provide the path to the nfig file. Additionally, you have to copy the previously nfig file inside the Docker image. Make sure to not commit it to your source control though. Instead of localhost, use the previously created PAT. Additionally, I have to add the PAT and a username to the nfig to be able to access the private NuGet feed. Locally, I don’t pass a PAT but I can set a default value. The file looks as follows: Use the PAT in the Dockerfileĭocker supports build arguments which I will use to pass the PAT inside the Dockerfile in the CI pipeline. Since this file gets committed to source control, I don’t add the PAT there because I want to keep it private. This file contains the URLs for the and private feed. The first step to restoring the NuGet package from the private feed is to add a nfig file to the root folder of the CustomerApi project. You can find the code of the demo on GitHub. The PAT got created Pass the PAT to build the Dockerfile locally
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |