博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS Docker 安装
阅读量:4621 次
发布时间:2019-06-09

本文共 2239 字,大约阅读时间需要 7 分钟。

 

前提条件

目前,CentOS 仅发行版本中的内核支持 Docker。

Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。

Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。

安装一些必要的系统工具

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

添加软件源信息:

yum-config-manager --add-repo
 
更新 yum 缓存: yum makecache fast
 

安装 Docker-ce:

yum -y install docker-ce
--> Processing Dependency: libseccomp.so.2()(64bit) for package: 3:docker-ce-18.09.0-3.el7.x86_64--> Processing Dependency: libsystemd.so.0()(64bit) for package: 3:docker-ce-18.09.0-3.el7.x86_64---> Package docker-ce-cli.x86_64 1:18.09.0-3.el7 will be installed--> Finished Dependency ResolutionError: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)           Requires: libsystemd.so.0()(64bit)Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)           Requires: container-selinux >= 2.9Error: Package: containerd.io-1.2.0-3.el7.x86_64 (docker-ce-stable)           Requires: systemdError: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)           Requires: libseccomp.so.2()(64bit)Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)           Requires: libc.so.6(GLIBC_2.17)(64bit)Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)           Requires: systemd-unitsError: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)           Requires: libsystemd.so.0(LIBSYSTEMD_209)(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest[root@computer7 ~]#
解决方法:升级内核(带aufs模块)
 

cd /etc/yum.repos.d

wget http://www.hop5.in/yum/el6/hop5.repo

yum install kernel-ml-aufs kernel-ml-aufs-devel

 
修改grub的主配置文件/etc/grub.conf,设置default=0,表示第一个title下的内容为默认启动的kernel(一般新安装的内核在第一个位置)。
 
 
重启系统,这时候你的内核就成功升级了。

查看内核是否支持aufs:

grep aufs /proc/filesystems

首先关闭selinux:

setenforce 0

sed -i '/^SELINUX=/c\SELINUX=disabled' /etc/selinux/config

  在Fedora EPEL源中已经提供了docker-io包,下载安装epel:

rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

sed -i 's/^mirrorlist=https/mirrorlist=http/' /etc/yum.repos.d/epel.repo

 

yum安装docker-io:

yum -y install docker-io

service docker start

docker  --version

 

 

 

refer to :

转载于:https://www.cnblogs.com/cs294639693/p/10164258.html

你可能感兴趣的文章
webpack的css,less,sass中使用绝对路径
查看>>
WindowBrush
查看>>
信息技术员多少分才算过?具体是做什么的?
查看>>
怎么在aspx里面添加swf文件
查看>>
React的diff算法
查看>>
Linux管理安全的基本技巧学习
查看>>
基于模板特化的Lua自动绑定系统
查看>>
折叠表格思路及遇到的问题(tableView:viewForHeaderInSection:的section从1开始,不是从0开始)...
查看>>
day06
查看>>
C++拷贝构造函数详解
查看>>
Balanced Binary Tree
查看>>
Single Element in a Sorted Array
查看>>
Image Smoother
查看>>
团队会议第十天
查看>>
Docker Machine 简介
查看>>
Docker配置镜像加速器重启Docker服务失败
查看>>
第一次设计作业
查看>>
桐花万里python路-基础篇-11-常用模块
查看>>
map.keyset() 不解
查看>>
1054. 求平均值 (20)(转载)
查看>>