前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >dockerfile构建镜像报错IPv4 forwarding is disabled

dockerfile构建镜像报错IPv4 forwarding is disabled

作者头像
dogfei
发布2020-07-31 15:07:35
8920
发布2020-07-31 15:07:35
举报
文章被收录于专栏:devops探索

报错记录:

Step 4/9 : RUN pip3 install -r /var/www/codo-admin/doc/requirements.txt —> [Warning] IPv4 forwarding is disabled. Networking will not work. —> Running in 94e64db68828 Collecting cryptography (from -r /var/www/codo-admin/doc/requirements.txt (line 1)) WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5cb088a470>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/cryptography/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5cb088a898>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/cryptography/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5cb088a6a0>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/cryptography/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5cb088a518>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/cryptography/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5cb088a358>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/cryptography/ ERROR: Could not find a version that satisfies the requirement cryptography (from -r /var/www/codo-admin/doc/requirements.txt (line 1)) (from versions: none) ERROR: No matching distribution found for cryptography (from -r /var/www/codo-admin/doc/requirements.txt (line 1))

这个是由于本地没有开启路由转发的缘故

解决办法:

代码语言:javascript
复制
vim /etc/sysctl.conf
net.ipv4.ip_forward=1   #添加即可

sysctl -p    #使其生效

这样还不行,还需要重启网卡和docker

代码语言:javascript
复制
systemctl restart network
systemctl restart docker

问题解决

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-09-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档