Centos | 软件安装
积累linux软件安装。
Docker
cat << EOF > /etc/yum.repos.d/docker-ce.repo
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/7/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
EOF
yum install -y docker-ce docker-ce-cli containerd.io bash-completion
cp /usr/share/bash-completion/completions/docker /etc/bash_completion.d/
[ ! -d /etc/docker ] && mkdir /etc/docker
cat << EOF > /etc/docker/daemon.json
{
"data-root": "/var/lib/docker",
"log-driver": "json-file",
"log-opts": {
"max-size": "200m",
"max-file": "5"
},
"default-ulimits": {
"nofile": {
"Name": "nofile",
"Hard": 655360,
"Soft": 655360
},
"nproc": {
"Name": "nproc",
"Hard": 655360,
"Soft": 655360
}
},
"live-restore": true,
"oom-score-adjust": -1000,
"max-concurrent-downloads": 10,
"max-concurrent-uploads": 10,
"storage-driver": "overlay2",
"storage-opts": ["overlay2.override_kernel_check=true"],
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": [
"https://yssx4sxy.mirror.aliyuncs.com/",
"http://hub-mirror.c.163.com/"
]
}
EOF
systemctl enable --now docker
Docker-compose
curl -L https://cdn.jsdelivr.net/gh/docker/compose@1.27.4/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
yq
文本字符串格式化成 yaml 格式的工具。
wget https://gh.con.sh/https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -O /usr/local/sbin/yq
chmod +x /usr/local/sbin/yq
jq
文本字符串格式化成 json 格式的工具。
wget https://gh.con.sh/https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /usr/local/sbin/jq
chmod +x /usr/local/sbin/jq