Closed INPRASHANDHI closed 1 year ago
Anyone can Advise on this..
Hello @INPRASHANDHI,
Thank you for writing. I'm not a Docker/container expert, but in researching this error, it usually occurs when the container host cannot access the internet and complete the dotnet restore. The Azure Namign Tool is a .NET 6 Blazor Server application. The container for this is based on the mcr.microsoft.com/dotnet/sdk:6.0 image.
In researching your error, it seems to occur when there is a proxy server the container is attempting to communicate out through. Is this the case? If not, is there are any firewall/gateway in place that could be preventing external access? I can tell you that there are no special paths/URLs with the Azure Naming Tool that it is attempting to load as part of the container creation process.
A good test may be to create a standard container and see if it gives the same error:
https://learn.microsoft.com/en-us/dotnet/core/docker/build-container?tabs=windows
Hope this helps!
Hello @BryanSoltis Thank you for the reply. I was able to fix the issue and it was the https proxy address issue that was not added.
Glad you got it working!
-Bryan
How did you fix it?
I am getting
[build 4/7] RUN dotnet restore "./AzureNamingTool.csproj":
0 0.850 Determining projects to restore...
0 8.204 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 17.25 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 24.63 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 31.75 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 39.21 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 46.63 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 54.01 /src/AzureNamingTool.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
0 54.05 Failed to restore /src/AzureNamingTool.csproj (in 52.93 sec).
Dockerfile:11
9 | WORKDIR /src 10 | COPY ["AzureNamingTool.csproj", "."] 11 | >>> RUN dotnet restore "./AzureNamingTool.csproj" 12 | COPY . . 13 | WORKDIR "/src/."
ERROR: failed to solve: process "/bin/sh -c dotnet restore \"./AzureNamingTool.csproj\"" did not complete successfully: exit code: 1
C:\Users\Dexter.Velasco\Downloads\CloudAdoptionFramework-master\CloudAdoptionFramework-master\ready\AzNamingTool>
Hello @BryanSoltis Thank you for the reply. I was able to fix the issue and it was the https proxy address issue that was not added.
What exactly was the fix?
Hello @BryanSoltis/ Anyone who can Help.
We are trying to run the Docker Image in Linux Server and executing the Command docker build -t azurenamingtool . there is an error showed like nu1301 unable to load the service index for source.
Like Below Image
Can you guide or help how we can solve this issue to move Forward.
Awaiting Reply....