Docker安装

一、准备 Centos 8 服务器

 

1、下载安装Centos 8

下载地址:https://www.centos.org/download/       建议安装mini不带gui版本的。

2、关闭防火墙

防火墙相关命令

#查看状态     
systemctl status firewalld.service

#打开防火墙 
systemctl start firewalld.service

#关闭防火墙 
systemctl stop firewalld.service

#开启防火墙 
systemctl enable firewalld.service

#禁用防火墙 
systemctl disable firewalld.service

  

 

二、安装docker

(1)从阿里云的镜像下载安装Docker

#安装yum-config-manager命令
yum -y install yum-utils
#添加阿里云的镜像repo
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
dnf install https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm
dnf install docker-ce

       或从docker官方的镜像下载安装Docker

#下载docker-ce的repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
#安装依赖(这是相比centos7的关键步骤)
yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
#安装docker-ce
yum install docker-ce

  

(2)启动docker

systemctl start docker

 

(3)查看docker状态

systemctl status docker

  

(4)设置开机启动

systemctl enable docker.service

  

posted @ 2020-08-26 17:25  燕马越空  阅读(130)  评论(0编辑  收藏  举报