Centos7 安装docker

  • A+
所属分类:Docker

yum安装docker

1.根据docker官方文档的要求系统内核最少是3.10,Centos默认内核版本3.10.0-123.el7.x86_64,所以不用升级内核

uname -r

2.更新系统(此步骤也可省略)

yum update

3.增加yum源

sudo yum install -y yum-utils;
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo;

4.安装docker-engine

sudo yum install docker-ce docker-ce-cli containerd.io -y

5.启动docker服务

systemctl enable docker.service;
systemctl start docker

脚本安装docker(安装时间比yum稍微长一些)

curl -fsSL https://get.docker.com/ | sh;
systemctl enable docker.service;
systemctl start docker

官方推荐用普通用户操作docker

groupadd docker
usermod -aG docker long

卸载docker

yum list installed | grep docker;
yum -y remove docker-engine.x86_64;
rm -rf /var/lib/docker;

 

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: