Linux安装Docker
要求:系统内核3.10及以上
[root@devops1 ~]# uname -a Linux devops1 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4 20:48:51 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
1. 卸载Docker或者清理残留
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
2. 下载需要的工具包
yum install -y yum-utils
3. 设置阿里云的Docker镜像仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4. 安装docker
yum -y install docker-ce docker-ce-cli containerd.io #出现completed即安装成功
5. 启动Docker并设置为开机自启
# 启动docker systemctl start docker # 开机自启 systemctl enable docker
6. 配置阿里云镜像
# * 代表需要自己到阿里云官网获取链接 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://*"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker