I am trying to dockerize a simple dotnetcore webapi on linux container on a windows 10 machine and whenever i build the dockerfile i get this error:
c:\\docker-tutrial>docker build -t docker-tutorial .
Sending build context to Docker daemon 1.364MB
Step 1/4 : FROM microsoft/dotnet:2.1 Get https://registry-1.docker.io/v2/ : net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I tried:
c:\\docker-tutrial>docker build --build -arg http_proxy= http://PROXY:8080 --build -arg https_proxy= http://PROXY:8080 -t docker-tutrial .
Get https://registry-1.docker.io/v2/ : net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
My Dockerfile is:
FROM microsoft/dotnet:2.1
WORKDIR /app
COPY ./publish .
ENTRYPOINT ["dotnet", "docker-tutrial.dll"]
I believe it is a proxy issue anyideas!!
It happened the same thing to me, after following various github issues I found out that the best way to overcome this problem is based on pure luck after doing these 4 steps:
These 4 steps usually solve the problem to me.
It worked after I fixed the command as greyhame mentioned: docker build --build -arg http_proxy= http://PROXY:8080 --build -arg https_proxy= https://PROXY:port -t docker-tutrial .
And i passed those two lines in the Dockerfile: ENV HTTP_PROXY "PROXY:PORT" ENV HTTPS_PROXY "PROXY:PORT"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.