修改knative func build的image

问题描述

基于func create创建的function的source code,并基于build创建出function对应的image。我们需在该image内创建安装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.https://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:https://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.https://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.https://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

你可能感兴趣的:(knative,云原生)