码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS7 安装Docker

时间:2019-09-13 22:32:40      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:后台服务   没有   移除   dev   app   fas   fast   inux   安装   

 

参考  https://www.runoob.com/docker/centos-docker-install.html

 

# 先移除旧的版本:
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine


# 安装一些必要的系统工具:
yum install -y yum-utils device-mapper-persistent-data lvm2
# 添加软件源信息:
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 更新 yum 缓存:
yum makecache fast
# 安装 Docker-ce:
yum -y install docker-ce
# 启动 Docker 后台服务
systemctl start docker
service docker start
# 重启 Docker 后台服务
systemctl restart docker
# 查看状态
systemctl status docker
systemctl status docker.service -l
# 重启
service docker restart
systemctl restart docker
# 查看版本
docker -v

  

# 更换镜像源 为国内镜像源
vi /etc/docker/daemon.json # 该文件没有手动添加
# https://registry.docker-cn.com、http://hub-mirror.c.163.com、https://registry.docker-cn.com
# storage-driver 存储驱动 "devicemapper"
{
"registry-mirrors" : ["http://hub-mirror.c.163.com"],
"storage-driver": "devicemapper"
}
# 重启docker
systemctl restart docker


# 删除 Docker CE:
sudo yum remove docker-ce
sudo rm -rf /var/lib/docker

  

 

CentOS7 安装Docker

标签:后台服务   没有   移除   dev   app   fas   fast   inux   安装   

原文地址:https://www.cnblogs.com/zelzzz/p/11517686.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!