From b47c611ab5098a29e57c564b05adf95b47b01db9 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 30 Dec 2020 15:04:28 +0800 Subject: [PATCH] add docker install --- install_docker.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 install_docker.sh diff --git a/install_docker.sh b/install_docker.sh new file mode 100644 index 0000000..999712c --- /dev/null +++ b/install_docker.sh @@ -0,0 +1,26 @@ +#!/bin/bash +##### CentOS 7安装Docker ##### + +cd +mkdir temp +cd temp + +#下载 +wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.3.9-3.1.el7.x86_64.rpm +wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-19.03.9-3.el7.x86_64.rpm +wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-19.03.9-3.el7.x86_64.rpm + +#安装 +yum -y install containerd.io-1.3.9-3.1.el7.x86_64.rpm +yum -y install docker-ce-19.03.9-3.el7.x86_64.rpm +yum -y install docker-ce-cli-19.03.9-3.el7.x86_64.rpm + +#启动docker +systemctl start docker +#开机启动 +systemctl enable docker + +echo '----------------------------------------' + +#运行一个hello word +docker run hello-world \ No newline at end of file