修改knative func build的image

问题描述

在基于knative func创建出的function内创建安装iperf3

解决步骤及遇到的errors

1. 查看本地的image,并运行该image

podman images
docker run -it -u root -p 10001:22 $target_image /bin/sh #进入镜像mindspore_hust:v5,同时将本机的1001端口映射到image的22端口

注意:这里一定要添加-u root(默认root用户没有密码);如果不指定,后续调用dnf install iperf3安装时会提示要使用root的超级权限。

2. 成功进入image后,安装iperf3

dnf update
dnf install iperf3

详细安装及使用内容参见卡片0

iperf安装Installing iperf on Red Hat Enterprise Linux 8 using dnf, testing network bandwidth to and from the system.icon-default.png?t=N7T8https://linuxconfig.org/how-to-install-iperf-on-redhat-8

直接安装iperf3时会抛出 Error: Unable to find a match: iperf3。为了解决该问题,需要先在redhat上进行注册(卡片2),获取username及password;然后对os进行subscription(卡片1),后者需要redhat的注册信息。上述两个步骤完成后便可正常安装iperf3。

首次执行 subscription-manager register,会抛出 subscription-manager is disabled when running inside a container. please refer to your host system for subscription management,该问题的解决办法是 从容器中删掉 "/etc/rhsm-host" (详见卡片3)。

Enable Subscription Management repositories on Redhat 8 Linux - Linux Tutorials - Learn Linux ConfigurationAfter installation of RHEL 8, Linux package repositories need to be enabled before you are able to install new packages. Any attempt to install new software will result with the following error message:icon-default.png?t=N7T8https://linuxconfig.org/enable-subscription-management-repositories-on-redhat-8-linuxHybrid Cloud Developer Tutorials and Software from Red Hat | Red Hat DeveloperJoin Red Hat Developer for the software and tutorials to develop hybrid cloud applications using Kubernetes, microservices, serverless and Linux.icon-default.png?t=N7T8https://developers.redhat.com/Subscription Manager - Red Hat Customer PortalHI, Please I got below error when I want to login: subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management. Thank you in advice.icon-default.png?t=N7T8https://access.redhat.com/discussions/5889431

具体名命令如下:

# 运行image
podman run -it -u root -p 10001:22 network-intensive:v1 /bin/sh 
dnf udpate

# remove /etc/rhsm-host, 否则会抛出subscription-manager is disabled when running inside a #container. Please refer to your host system for subscription management.
mv  /etc/rhsm-host  /etc/rhsm-host-bk

# 注册red hat

#enable subscription
subscription-manager register
subscription-manager list --available #记录这里生成的pool id
subscription-manager attach --pool=2c94ed35887328c20188ad50675e2ac1
subscription-manager list
dnf repolist
subscription-manager repos --list 

#install iperf3
dnf install iperf3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值