docker - docker build 在 Kubernetes 节点中失败
问题描述
使用 Kops 设置 K8s 集群
export KOPS_STATE_STORE=s3://clusters.aind.devops
export ZONES=ap-south-1a
export VPC=vpc-xxxxx
export node_count=2
export node_size=m4.large
export master_size=t2.medium
export api_loadbalancer_type=public
export topology=private
export dns=private
export dns_zone=Z25L42E21ILH89
export CLIENT=test
它创建了 2 个节点和一个主节点,我尝试设置 Jenkins docker build slave 以在 pod 中构建 docker 映像
我的构建失败了
Sending build context to Docker daemon 15.36 kB
Step 1/3 : FROM ubuntu
---> cd6d8154f1e1
Step 2/3 : RUN apt-get update -y
---> Using cache
---> 8007c6693623
Step 3/3 : RUN apt-get install vim -y
---> Running in cbbafcb6a37b
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package vim
The command '/bin/sh -c apt-get install vim -y' returned a non-zero code: 100
当我登录节点并运行相同的构建时,它在那里失败了,似乎 docker daemon 没有得到 DNS resoultion
请帮忙
解决方案
尝试指定 Docker 构建选项--network host
。即使主机可以,我也看到了 Docker 容器无法到达网络的地方。
推荐阅读
- python - 为什么 multiprocessing.Pool 不能线性增加计算速度?
- android - 为什么 android 内核日志在启动时显示不同的时间戳(日期和时间)?
- excel - 将工作表名称添加到 VBA 中的所有公式引用
- mysql - MySQL 查询性能非常依赖于 Where 子句
- c# - 在数据类型不固定的情况下读取 SQL 查询的结果
- python - 熊猫数据框中每个时期的一个图
- tableau-api - 如何使用 Tableau 修复字段或列值中的拼写错误
- css - 滑动手势菜单
- regex - 需要从 cmd 输出中截断无用的文本
- sql - oracle如何从case语句中获取函数返回结果