FPGA云原生 Xilinx FPGA_as_a_Service之Xilinx Base Runtime脚本分析 /utilities/docker_install.sh

网友投稿 622 2022-10-14

FPGA云原生 Xilinx FPGA_as_a_Service之Xilinx Base Runtime脚本分析 /utilities/docker_install.sh

FPGA云原生 Xilinx FPGA_as_a_Service之Xilinx Base Runtime脚本分析 /utilities/docker_install.sh

Xilinx FPGA_as_a_Service之Xilinx Base Runtime脚本分析 host_setup.sh运行会调用/utilities/docker_install.sh脚本安装docker。在该产品中有一个Dockerfiles文件夹。目录结构如下所示,针对不同的版本的XRT有不同的文件夹,文件夹下有针对不同操作系统的

Dockerfile文件,用于创建镜像。

首先是确认运行用户是root,然后确认系统是否已经安装docker了。如果已经安装,打印docker版本;如果没有安装,

if [[ $EUID -ne 0 ]]; then echo "This script must be run as root. " exit 1fiOSVERSION=`grep '^ID=' /etc/os-release | awk -F= '{print $2}' | tr -d '"'`if [[ "$OSVERSION" == "ubuntu" ]]; then DOCKER_INFO=`apt list --installed 2>/dev/null | grep docker-ce`elif [[ "$OSVERSION" == "centos" ]]; then DOCKER_INFO=`yum list installed 2>/dev/null | grep docker-ce`else echo "The script supports: Ubuntu 16.04, Ubuntu 18.04 and Centos 7. For other operating system, please install DockerCE manually following: exit 1fiif [ $? == 0 ] ; then echo "You have already installed docker." DOCKER_INFO=`docker info 2>/dev/null` if [ $? == 0 ] ; then DOCKER_VERSION=`docker info 2>/dev/null |grep "Server Version"| awk -F: '{print $2}'` echo "Docker Version:$DOCKER_VERSION" else docker info fielse echo "Install docker on $OSVERSION..." if [[ "$OSVERSION" == "ubuntu" ]]; then apt-get -y update && apt-get install -y curl fi curl -fsSL | sh > /tmp/xxappstore_hostsetup_installdocker.log 2>&1 if [[ $? != 0 ]]; then echo "[ERROR] Unable to install DockerCE using Docker automated script" echo "Please install DockerCE manually following this documentation:" if [[ "$OSVERSION" == "ubuntu" ]]; then echo ' > [UBUNTU] elif [[ "$OSVERSION" == "centos" ]]; then echo ' > [CENTOS] fi exit 1 fi echo "Configure docker" mkdir -p /etc/docker && echo '{"max-concurrent-downloads": 1}' | tee -a /etc/docker/daemon.json && systemctl restart docker && systemctl enable docker > /tmp/xxappstore_hostsetup_configuredocker.log 2>&1 if [[ $? != 0 ]]; then echo "[ERROR] Docker Configuration. Check log file /tmp/xxappstore_hostsetup_configuredocker.log" exit 1 fi echo "Verify that Docker Engine is installed correctly by running the hello-world image." echo "" echo " docker run hello-world" echo "" echo "If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:" echo "" echo " usermod -aG docker your-user" echo "" echo "Install docker completed"fi

分析一下如下命令 mkdir -p /etc/docker && echo ‘{“max-concurrent-downloads”: 1}’ | tee -a /etc/docker/daemon.json && systemctl restart docker && systemctl enable docker > /tmp/xxappstore_hostsetup_configuredocker.log 2>&1

Dockerfile文件,以201902 centos举例

FROM centos:7#Install dependenciesRUN yum install -y epel-release; yum install -y boost-devel boost-filesystem dkms libboost_filesystem-mt.so.1.53.0 libboost_filesystem.so.1.53.0 libboost_system-mt.so.1.53.0 libboost_system.so.1.53.0 libprotobuf.so.8 libuuid-devel libxml2-devel libyaml-0.1.4-11.el7_0.x86_64 libyaml-devel ncurses-devel ocl-icd-devel openssl-devel protobuf-compiler protobuf-devel python-pip redhat-lsb-core libxml-2.0 yaml-0.1 wget#Dowload XRT installation packages from Xilinx lounge pageRUN wget -cO - > /root/xrt_201920.2.3.1301_7.4.1708-xrt.rpm#Install XRT RUN rpm -i /root/xrt_201920.2.3.1301_7.4.1708-xrt.rpm#Copy notice and disclaimerADD Xilinx_notice_and_disclaimer.txt /Xilinx_notice_and_disclaimer.txt

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Luminus- Clojure 微框架
下一篇:CSS响应式布局实例
相关文章

 发表评论

暂时没有评论,来抢沙发吧~