代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。