k8s容器安装ifconfig,netstat,telnet,vim,ping命令工具

很多开源的容器镜像都缺乏很多命令,而有时我们又得进行测试,开源的容器镜像大多数是debain系统构建的,本博客介绍如何在容器安装各类常用工具。
进入容器,重新配置debain源为阿里云源:

mv /etc/apt/sources.list /etc/apt/sources.list.bak
tee /etc/apt/sources.list << EOF

deb http://mirrors.aliyun.com/debian stable main contrib non-free

deb http://mirrors.aliyun.com/debian stable-proposed-updates main contrib non-free

deb http://mirrors.aliyun.com/debian stable-updates main contrib non-free

deb-src http://mirrors.aliyun.com/debian stable main contrib non-free

deb-src http://mirrors.aliyun.com/debian stable-proposed-updates main contrib non-free

deb-src http://mirrors.aliyun.com/debian stable-updates main contrib non-free
EOF

很多容器发觉无ifconfig,netstat命令,其实是缺乏net-tools包:

apt-get update && apt-get install net-tools -y

很多容器发觉无ps命令,其实是缺乏procps包

apt-get update && apt-get  install  procps -y

安装telnet

apt-get update && apt-get  install telnet -y

安装curl

apt-get update && apt-get  install curl -y

安装ping

apt-get install inetutils-ping -y

安装vim

apt-get install vim -y
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值