【发布时间】:2021-05-05 20:52:56
【问题描述】:
尝试在 Kubernetes 上使用官方 jetbrains\teamcity-agent 镜像。我已经设法在 Docker 中运行 Docker,但尝试使用 docker build 命令构建 ASP.NET Core 映像在 dotnet restore 上失败
对“GET https://api.nuget.org/v3/index.json”的 HTTP 请求在 100000 毫秒后超时。
当我连接到 pod 本身并尝试curling URL 时,它的速度非常快。所以我认为网络不是问题。感谢您的建议。
更新
尝试从容器运行一个简单的dotnet restore 步骤。但不是来自docker build。
更新 2
我已经隔离了这个问题,它与 nuget 或 TeamCity 无关。是否与 Kubernetes 主机上的网络相关。
使用这个Dockerfile运行简单的docker build:
FROM praqma/network-multitool AS build
RUN route
RUN ping -c 4 google.com
产生输出:
Step 1/3 : FROM praqma/network-multitool AS build
---> 3619cb81e582
Step 2/3 : RUN route
---> Running in 80bda13a9860
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.17.0.1 0.0.0.0 UG 0 0 0 eth0
172.17.0.0 * 255.255.0.0 U 0 0 0 eth0
Removing intermediate container 80bda13a9860
---> d79e864eafaf
Step 3/3 : RUN ping -c 4 google.com
---> Running in 76354a92a413
PING google.com (216.58.201.110) 56(84) bytes of data.
--- google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 53ms
Kubernetes 编排的 Pod 可以正常访问互联网。我使用 Calico 作为网络层。
【问题讨论】:
-
理解不够给你答案
-
请添加更多标签
dockerdotnetcore-sdk@Jan Zahradník
标签: kubernetes routing timeout