-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The command 'cmd /S /C dotnet restore' returned a non-zero code: 1 #247
Comments
@sharadrumane The error message you are seeing is indicative of the container being unable to connect to NuGet.org (NuGet/Home#8805) Are you using a Proxy? Probably not related but worth noting: |
@NCarlsonMSFT i am not using any proxy. i am not able to identify whether container is able to access |
Start a container from the command line with the command Within the container run:
Assuming the call does fail, it would also be worth trying to connect to other sites. For instance: |
@NCarlsonMSFT by executing above command i am getting below error i tried curl https://github.com but also got same error curl: (6) Could not resolve host: github.com i tried running dotnet nuget locals http-cache --clear. but it didnt work |
The same issue in mcr.microsoft.com/dotnet/core/sdk:3.1 image: |
@StruninIhor based on what you are seeing you appear to be having a networking issue with your windows containers. There is an existing issue in the docker repo that appears to have some good troubleshooting steps I would recommend you try: Windows containers can't access the internet. If those steps aren't able to resolve your issue, opening a new issue in that repro will get you connected to the right experts to help you. |
@NCarlsonMSFT I tried the steps mention in the link you provided Windows containers can't access the internet #2760. but it didn't work for me. |
@sharadrumane then I would advise as your next step opening an issue in that repo. Your issue appears to be a general issue with windows containers and that is the best place to get help for that. |
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1809 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/runtime:3.0-nanoserver-1809
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "piwebapimodule.dll"]
#above is my dockerfile and below is the error i am getting.
Step 4/10 : RUN dotnet restore
---> Running in 2d8bfe25d6ab
C:\Program Files\dotnet\sdk\2.2.207\NuGet.targets(119,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\app\abcd.csproj]
C:\Program Files\dotnet\sdk\2.2.207\NuGet.targets(119,5): error : No such host is known [C:\app\abcd.csproj]
The command 'cmd /S /C dotnet restore' returned a non-zero code: 1
i am trying to build and push the image on edge device which is a windows based. i am using VS Code as my IDE. when i am linux VM i am able to build and push the image easily but in case of windows VM i am getting above error.
The text was updated successfully, but these errors were encountered: