2 Star 1 Fork 1

ltfafei/shell_script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Install_docker(all).sh 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
ltfafei 提交于 2020-08-31 08:53 . Add shell script
#!/bin/bash
# Write by afei
. /etc/os-release
case "$ID" in
rhel*|centos*)
# install docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce -y
docker -v
systemctl start docker
;;
ubuntu*|kali)
# Install rely
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
# Add repo
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" >> /etc/apt/sources.list.d/docker.list
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Install docker
apt-get update
apt install docker-ce -y
docker -v
systemctl start docker
;;
*)
echo "Unknow System!"
esac
# Speed docker
mkdir /etc/docker
cat >> /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://gzvb5ox3.mirror.aliyuncs.com"]
}
EOF
systemctl reload docker && systemctl restart docker && systemctl enable docker
docker info |tail
# Test docker
docker pull hello-world && docker images
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/afei00123/shell_script.git
git@gitee.com:afei00123/shell_script.git
afei00123
shell_script
shell_script
master

搜索帮助