Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 1.4 KB

File metadata and controls

87 lines (61 loc) · 1.4 KB

安装docker

安装

centos

包安装

卸载旧版本

sudo yum remove docker \
docker-common \
docker-selinux \
docker-engine

安装依赖包

sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

添加yum源

# 官方源
# sudo yum-config-manager \
#--add-repo \
#https://download.docker.com/linux/centos/docker-ce.repo

# 建议使用国内源
sudo yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安装最新版本的docker-ce

sudo yum-config-manager --enable docker-ce-edge

安装测试版本的docker-ce

sudo yum-config-manager --enable docker-ce-test

安装稳定版本

sudo yum makecache fast
sudo yum install docker-ce docker-ce-cli containerd.io

通过脚本安装

curl -fsSL https://get.docker.com/ | sh
# or
wget -qO- https://get.docker.com/ | sh

配置镜像加速

linux

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

macos

右键点击桌面顶栏的 docker 图标,选择 Preferences ,在 Daemon 标签(Docker 17.03 之前版本为 Advanced 标签)下的 Registry mirrors 列表中加入下面的镜像地址:

$ http://f1361db2.m.daocloud.io

配置完成后重启docker即可生效

sudo systemctl restart docker