Docker - 通过快速脚本在不同的环境下一键安装Docker
1、在 CentOS/RHEL 中安装 Docker
安装脚本
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.daocloud.io/docker/linux/centos/docker-ce.repo
sudo yum install -y -q docker-ce-.ce* docker-ce-selinux-.ce*
sudo systemctl enable docker
sudo systemctl start docker
sudo service docker status
2、在 Ubuntu 中安装 Docker
安装脚本
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.daocloud.io/docker/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=$(dpkg --print-architecture)] https://download.daocloud.io/docker/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y -q docker-ce=*
sudo service docker start
sudo service docker status
3、在 SLES 中安装 Docker
安装脚本
sudo zypper ref
sudo zypper ar -t YUM https://yum.dockerproject.org/repo/main/opensuse/13.2 docker
sudo zypper refresh
sudo zypper install docker-engine-.ce-1
sudo systemctl enable docker.service
sudo systemctl start docker.service
sudo service docker status
4、在 Fedora 中安装 Docker
安装脚本
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager \
--add-repo \
https://download.daocloud.io/docker/linux/fedora/docker-ce.repo
sudo dnf -y install docker-ce-*
sudo systemctl start docker
5、在 Debian 中安装 Docker
安装脚本【局限于 Jessie 或 Stretch 版本】
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.daocloud.io/docker/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=$(dpkg --print-architecture)] https://download.daocloud.io/docker/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y -q docker-ce=*
sudo service docker start
sudo service docker status
安装脚本【局限于 Wheezy版本】
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
python-software-properties
curl -fsSL https://download.daocloud.io/docker/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=$(dpkg --print-architecture)] https://download.daocloud.io/docker/linux/debian \
$(lsb_release -cs) \
stable"
sudo sed '/^deb-src.*download.daocloud.io.*/ s/^/#/g' -i /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y -q docker-ce=*
sudo service docker start
sudo service docker status
6、在 其他 Linux 操作系统 中安装 Docker
下载脚本
curl -sSL https://get.daocloud.io/docker | sh
启动脚本
sudo service docker start
sudo docker info
7、自己下载压缩包进行安装
安装脚本
tar -zxvf docker-offline--ce-<operating-system>.tar.gz
cd docker-offline--ce-<operating-system>
sudo chmod +x install.sh
sudo bash install.sh