其他系统版本

CentOS安装Docker

不同版本只是安装包命令不同而已

安装Docker

更新系统包

1
[email protected]:~# sudo apt-get update

安装需要安装的工具包

1
[email protected]:~# sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

配置apt源安装docker源

1
[email protected]:~# sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" && sudo apt-get update 

安装Docker

1
[email protected]:~# sudo apt-get install -y docker-ce

创建daemon配置文件/etc/docker/daemon.json来使用加速器

1
2
3
4
5
6
7
8
[email protected]:~# sudo mkdir -p /etc/docker
[email protected]:~# sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://lo831hm4.mirror.aliyuncs.com"]
}
EOF
[email protected]:~# sudo systemctl daemon-reload
[email protected]:~# sudo systemctl restart docker