整体参考Linux相关服务器系统的环境初始化工作。
源以及其他相关初始化脚本可以直接复用:
centos 7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| curl "https://mirrors.aliyun.com/repo/Centos-7.repo" -o /etc/yum.repos.d/CentOS-Base.repo curl "http://mirrors.aliyun.com/repo/epel-7.repo" -o /etc/yum.repos.d/epel.repo;
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo yum makecache fast; yum update -y; yum upgrade -y; yum install -y yum-config-manager; yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo; yum install -y bind-utils centos-release-scl devtoolset-11-gcc* libsodium vim git java-11-openjdk-devel.x86_64 python3 centos-release-scl ntp ntpdate open-vm-tools yum-utils device-mapper-persistent-data lvm2 nginx-mod-stream qemu-kvm qemu-img virt-manager libvirt libvirt-python virt-manager libvirt-client virt-install virt-viewer zlib-devel libffi-devel libuuid-devel readline-devel tk tk-devel ncurses-libs sqlite sqlite-devel bzip2-devel openssl-devel gdbm gdbm-devel libdbi-devel xz-devel python-backports-lzma mpdecimal expat libretls db4-devel libpcap-devel lzma xz perl-CPAN perl-IPC-Cmd gcc-c++ kernel-devel; yum groupinstall -y 'Development Tools'; scl enable devtoolset-11 bash ldconfig /usr/local/lib/ ldconfig /usr/local/lib64/ yum install -y docker-ce docker-ce-cli containerd.io; mkdir -p /etc/docker; ntpdate -u -s ntp1.aliyun.com ntp2.aliyun.com ntp2.aliyun.com
|
这里使用的是阿里云的镜像,可以参见阿里云的说明:https://developer.aliyun.com/mirror/
也推荐使用华为云的镜像:https://mirrors.huaweicloud.com/