Skip to content
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

Error "CTC1014" Docker command failed with exit code 1. The command 'cmd /S /C dotnet restore "AssignmentDeltaXAPI/AssignmentDeltaXAPI.csproj"' returned a non-zero code: 1 #350

Closed
ks1990cn opened this issue Aug 3, 2022 · 6 comments

Comments

@ks1990cn
Copy link

ks1990cn commented Aug 3, 2022

Hi All,

I've one repo : https://github.com/ks1990cn/Demo_API_For_IMDB
In this repo, my Docker File is at https://github.com/ks1990cn/Demo_API_For_IMDB/tree/main/API/AssignmentDeltaXAPI

I tried to create Docker image using docker support tool for windows by referring to https://www.youtube.com/watch?v=k2sskhYEPkI

I just right clicked on my API -> Docker support -> For Windows then tried to build the image.

If I select to run & debug using Docker its running fine but getting error when I tried to build this image.

I also referred to #247 (#247) but didn't worked for me.

Please let me know if anyone need further information and kindly help me on this.

Thanks!

@NCarlsonMSFT
Copy link
Member

@ks1990cn the logs from the docker build hopefully contain an error message from the NuGet restore.
I downloaded your repro locally and it built for me, so this does seem like it may be a networking issue.
Bonus info request. What output do you get if you run docker run -it mcr.microsoft.com/dotnet/sdk:5.0 curl https://api.nuget.org/v3/index.json.

@ks1990cn
Copy link
Author

ks1990cn commented Aug 4, 2022

@NCarlsonMSFT here are logs:

C:\Users\tanmays>docker pull mcr.microsoft.com/dotnet/sdk:5.0
5.0: Pulling from dotnet/sdk
Digest: sha256:3ff465d940de3e2c727794d92fd7bb649c498d4abd91bc9213ea7831ebf01f1e
Status: Image is up to date for mcr.microsoft.com/dotnet/sdk:5.0
mcr.microsoft.com/dotnet/sdk:5.0

C:\Users\tanmays>docker run -it mcr.microsoft.com/dotnet/sdk:5.0 curl https://api.nuget.org/v3/index.json
curl: (6) Could not resolve host: api.nuget.org

How to resolve this nuget issue cause I'm unable to publish it to docker hub too.

@NCarlsonMSFT
Copy link
Member

@ks1990cn the error you're getting from curl suggests that your container is having DNS issues.
Is your host using a proxy? If so take a look at https://docs.docker.com/network/proxy/ to make sure your container is using it too.
Are you able to use curl to connect to other sites, for instance: docker run -it mcr.microsoft.com/dotnet/sdk:5.0 curl http://www.microsoft.com/?

@ks1990cn
Copy link
Author

ks1990cn commented Aug 9, 2022

Yeah seems like issue with my path... something is wrong with my docker file should be in root directory!

I'll try again.. we can close this for now... but if required I'll text you here!

Thanks for great support.

@ks1990cn ks1990cn closed this as completed Aug 9, 2022
@NCarlsonMSFT
Copy link
Member

@ks1990cn FYI: The Dockerfile not being at the root is the expected behavior of the Dockerfile scaffolding in VS. To support building in a container with project to project references we set the build context to the solution folder but still place the dockerfile in the project folder.

Regardless of that, your inability to connect using curl when directly running the image still points to a networking issue that is broader than the individual container / Dockerfile used in this project

@ks1990cn ks1990cn reopened this Aug 17, 2022
@ks1990cn
Copy link
Author

Yes I tried creating any other application, it worked for it... but still an issue for this

I need to explore about host proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants