[英]Docker image isn't building: Linux container
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: 我正在尝试在Windows 10计算机上的linux容器上对简单的dotnetcore webapi进行docker化,每当我构建dockerfile时,都会出现此错误:
c:\\docker-tutrial>docker build -t docker-tutorial .
c:\\ docker-tutrial> docker build -t docker-tutorial。
Sending build context to Docker daemon 1.364MB
将构建上下文发送到Docker守护程序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)
步骤1/4:来自microsoft / dotnet:2.1获取https://registry-1.docker.io/v2/:net / http:等待连接时请求被取消(等待头时超出了Client.Timeout)
I tried: 我试过了:
c:\\docker-tutrial>docker build --build -arg http_proxy= http://PROXY:8080 --build -arg https_proxy= http://PROXY:8080 -t docker-tutrial .
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)
获取https://registry-1.docker.io/v2/:net / http:等待连接时请求被取消(等待标头时超过Client.Timeout)
My Dockerfile is: 我的Dockerfile是:
FROM microsoft/dotnet:2.1
WORKDIR /app
COPY ./publish .
ENTRYPOINT ["dotnet", "docker-tutrial.dll"]
I believe it is a proxy issue anyideas!! 我相信这是代理问题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: 在经历了各种github问题之后,我发生了同样的事情,我发现克服此问题的最佳方法是基于完成这4个步骤后的运气:
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 . 在我修复了Greyhame提到的命令后,它起作用了: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" 我在Dockerfile中传递了这两行:ENV HTTP_PROXY“ PROXY:PORT” ENV HTTPS_PROXY“ PROXY:PORT”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.