iSulad/0068-Readme-add-script-to-install-iSulad-on-Centos7.patch
WangFengTu b1ffa045c4 iSulad: sync with upstream iSulad
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
2021-05-18 14:48:15 +08:00

199 lines
5.7 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 38b5c74dcce5fc61438ce03252c14c9b5a009d81 Mon Sep 17 00:00:00 2001
From: Li Feng <lifeng2221dd1@zoho.com.cn>
Date: Wed, 7 Apr 2021 11:34:21 +0800
Subject: [PATCH 068/104] Readme: add script to install iSulad on Centos7
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
---
docs/build_guide.md | 9 +-
docs/build_guide_zh.md | 8 +-
docs/install_iSulad_on_Centos_7.sh | 137 +++++++++++++++++++++++++++++
3 files changed, 150 insertions(+), 4 deletions(-)
create mode 100644 docs/install_iSulad_on_Centos_7.sh
diff --git a/docs/build_guide.md b/docs/build_guide.md
index d710cbbb..449767ae 100644
--- a/docs/build_guide.md
+++ b/docs/build_guide.md
@@ -7,8 +7,13 @@ If you intend to contribute on iSulad. Thanks for your effort. Every contributio
These dependencies are required for build:
### install basic dependencies based on Centos distribution
-```bash
-$ sudo yum --enablerepo='*' install -y automake autoconf libtool cmake make libcap libcap-devel libselinux libselinux-devel libseccomp libseccomp-devel yajl-devel git libcgroup tar python3 python3-pip device-mapper-devel libarchive libarchive-devel libcurl-devel zlib-devel glibc-headers openssl-devel gcc gcc-c++ systemd-devel systemd-libs golang libtar libtar-devel
+
+We provided a script to auto install iSulad on centos7, you can just execute the script to install iSulad.
+
+```sh
+$ git clone https://gitee.com/openeuler/iSulad.git
+$ cd iSulad/docs
+$ sudo ./install_iSulad_on_Centos_7.sh
```
### install basic dependencies based on Ubuntu distribution
diff --git a/docs/build_guide_zh.md b/docs/build_guide_zh.md
index d6621fcf..2cb709e8 100644
--- a/docs/build_guide_zh.md
+++ b/docs/build_guide_zh.md
@@ -18,8 +18,12 @@ dnf builddep iSulad.spec
### Centos的安装命令
-```bash
-$ sudo yum --enablerepo='*' install -y automake autoconf libtool cmake make libcap libcap-devel libselinux libselinux-devel libseccomp libseccomp-devel yajl-devel git libcgroup tar python3 python3-pip device-mapper-devel libarchive libarchive-devel libcurl-devel zlib-devel glibc-headers openssl-devel gcc gcc-c++ systemd-devel systemd-libs libtar libtar-devel
+我们在代码仓中提供了在Centos7上自动化安装的脚本您只需要执行这个脚本就可以自动编译安装iSulad以及其依赖的组件。
+
+```sh
+$ git clone https://gitee.com/openeuler/iSulad.git
+$ cd iSulad/docs
+$ sudo ./install_iSulad_on_Centos_7.sh
```
### Ubuntu的安装命令
diff --git a/docs/install_iSulad_on_Centos_7.sh b/docs/install_iSulad_on_Centos_7.sh
new file mode 100644
index 00000000..48aff5cf
--- /dev/null
+++ b/docs/install_iSulad_on_Centos_7.sh
@@ -0,0 +1,137 @@
+#/bin/bash
+
+
+set -x
+set -e
+
+# install neccessary packages
+yum install -y patch automake autoconf libtool cmake make libcap libcap-devel libselinux libselinux-devel libseccomp libseccomp-devel yajl-devel git libcgroup tar python3 python3-pip device-mapper-devel libcurl-devel zlib-devel glibc-headers openssl-devel gcc gcc-c++ systemd-devel systemd-libs golang libtar libtar-devel
+
+# export LDFLAGS
+export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
+export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH
+ echo "/usr/local/lib" >> /etc/ld.so.conf
+
+BUILD_DIR=/tmp/build_isulad
+
+rm -rf $BUILD_DIR
+mkdir -p $BUILD_DIR
+
+# build libarchive
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/libarchive.git
+cd libarchive
+git checkout -b openEuler-20.03-LTS-tag openEuler-20.03-LTS-tag
+tar -zxvf libarchive-3.4.1.tar.gz
+cd libarchive-3.4.1
+patch -p1 -F1 -s < ../libarchive-uninitialized-value.patch
+cd build
+cmake -DCMAKE_USE_SYSTEM_LIBRARIES=ON ../
+make -j $(nproc)
+make install
+ldconfig
+
+# build protobuf
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/protobuf.git
+cd protobuf
+git checkout openEuler-20.03-LTS-tag
+tar -xzvf protobuf-all-3.9.0.tar.gz
+cd protobuf-3.9.0
+./autogen.sh
+./configure
+make -j $(nproc)
+make install
+ldconfig
+
+# build c-ares
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/c-ares.git
+cd c-ares
+git checkout openEuler-20.03-LTS-tag
+tar -xzvf c-ares-1.15.0.tar.gz
+cd c-ares-1.15.0
+autoreconf -if
+./configure --enable-shared --disable-dependency-tracking
+make -j $(nproc)
+make install
+ldconfig
+
+# build grpc
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/grpc.git
+cd grpc
+git checkout openEuler-20.03-LTS-tag
+tar -xzvf grpc-1.22.0.tar.gz
+cd grpc-1.22.0
+make -j $(nproc)
+make install
+ldconfig
+
+# build http_parser
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/http-parser.git
+cd http-parser
+git checkout openEuler-20.03-LTS-tag
+tar -xzvf http-parser-2.9.2.tar.gz
+cd http-parser-2.9.2
+make -j CFLAGS="-Wno-error"
+make CFLAGS="-Wno-error" install
+ldconfig
+
+# build libwebsockets
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/libwebsockets.git
+cd libwebsockets
+git checkout openEuler-20.03-LTS-tag
+tar -xzvf libwebsockets-2.4.2.tar.gz
+cd libwebsockets-2.4.2
+patch -p1 -F1 -s < ../libwebsockets-fix-coredump.patch
+mkdir build
+cd build
+cmake -DLWS_WITH_SSL=0 -DLWS_MAX_SMP=32 -DCMAKE_BUILD_TYPE=Debug ../
+make -j $(nproc)
+make install
+ldconfig
+
+# build lxc
+cd $BUILD_DIR
+git clone https://gitee.com/src-openeuler/lxc.git
+cd lxc
+tar -zxf lxc-4.0.3.tar.gz
+./apply-patches
+cd lxc-4.0.3
+./autogen.sh
+./configure
+make -j
+make install
+
+# build lcr
+cd $BUILD_DIR
+git clone https://gitee.com/openeuler/lcr.git
+cd lcr
+mkdir build
+cd build
+cmake ..
+make -j
+make install
+
+# build and install clibcni
+cd $BUILD_DIR
+git clone https://gitee.com/openeuler/clibcni.git
+cd clibcni
+mkdir build
+cd build
+cmake ..
+make -j
+make install
+
+# build and install iSulad
+cd $BUILD_DIR
+git clone https://gitee.com/openeuler/iSulad.git
+cd iSulad
+mkdir build
+cd build
+cmake ..
+make
+make install
--
2.25.1