Centos 7 Docker安装配置
版本介绍
Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE。
社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如经过官方测试认证过的基础设施、容器、插件等。
社区版按照stable和edge两种方式发布,每个季度更新stable版本,如17.06,17.09;每个月份更新edge版本
开始安装
1、Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。
通过 uname -r 命令查看你当前的内核版本
uname -r
2、使用 root 权限登录 Centos。确保 yum 包更新到最新。(可选)
yum update
3、卸载旧版本(如果安装过旧版本的话)
yum remove docker docker-common docker-selinux docker-engine
4、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
yum install -y yum-utils device-mapper-persistent-data lvm2
5、设置yum源(二选一)
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo #国外经常不通
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #阿里云
6、可以查看所有仓库中所有docker版本,并选择特定版本安装
yum list docker-ce --showduplicates | sort -r
7、安装docker
yum install docker-ce -y #由于repo中默认只开启stable仓库,故这里安装的是最新稳定版17.12.0
yum install <FQPN> -y # 例如:sudo yum install docker-ce-17.12.0.ce
8、启动并加入开机启动
systemctl start docker
systemctl enable docker
9、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)
docker version
赋予其他用户执行docker权限
1.如果还没有 docker group 就添加一个:
sudo groupadd docker
2. 将用户加入该 group 内。然后退出并重新登录就生效啦。
sudo gpasswd -a ${USER} docker #${USER} 替换为你想赋予权限的用户
3.重启 docker 服务
sudo service docker restart 或 sudo systemctl restart docker
4.切换当前会话到新 group 或者重启 X 会话
newgrp docker 或者 pkill X
注意,最后一步是必须的,否则因为 groups 命令获取到的是缓存的组信息,刚添加的组信息未能生效,所以 docker images 执行时同样有错。
更改镜像源
1. Docker 官方中国区
https://registry.docker-cn.com
2. 网易
http://hub-mirror.c.163.com
3. ustc
https://docker.mirrors.ustc.edu.cn
修改方法
新版的 Docker 推荐使用 json 配置文件的方式,默认为 /etc/docker/daemon.json,非默认路径需要修改 dockerd 的 –config-file,在该文件中加入如下内容:
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}
配置镜像加速器
针对Docker客户端版本大于 1.10.0 的用户
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
例如:
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://5pfgd8r1.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
镜像加速参考链接:https://help.aliyun.com/document_detail/60750.htm
阿里云提供了很多镜像源,直达车:https://opsx.alibaba.com/mirror
Centos 7 Docker安装配置的更多相关文章
- CentOS下Docker安装
CentOS下Docker安装 1.安装: #sudo yum install docker 2.启动并加入开机启动: A.#sudo systemctl start docker B.#sudo s ...
- docker安装配置
########################################## #docker安装配置 #环境centos7 #配置docker阿里源 echo '#Docker [docker ...
- centos7 docker 安装配置
docker快速入门测试 ########################################## #docker安装配置 #环境centos7 #配置docker阿里源 echo '#D ...
- CentOS 7.0安装配置Vsftp服务器
一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...
- CentOS 6.6安装配置LAMP服务器(Apache+PHP5+MySQL)
准备篇: CentOS 6.6系统安装配置图解教程 http://www.osyunwei.com/archives/8398.html 1.配置防火墙,开启80端口.3306端口 vi /etc/s ...
- CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)
CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: /etc/init.d/iptables stop #关闭防火墙 关闭SELINUX vi /etc/sel ...
- CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)
这篇文章主要介绍了CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)的方法,需要的朋友可以参考下 文章写的不错,很详细:IDO转载自网络: 准备篇: 1.配置防火墙,开启 ...
- centOS下yum安装配置samba
centOS下yum安装配置samba 2010-03-29 15:46:00 标签:samba yum centOS 安装 休闲 注意:本文的原则是只将文件共享应用于内网服务器,并让将要被共享的目 ...
- CentOS 7.0安装配置LAMP服务器(Apache+PHP+MariaDB)
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止fir ...
随机推荐
- curl 抓取图片
/** * curl 抓取图片 * @param $url * @return mixed */ public static function downLoadImage($url) { $heade ...
- Cookie&Session与自定义session
cookie与session的区别? cookie是保存在浏览器端的键值对 session是保存在服务器端的键值对 session依赖于cookie 摘自: http://bubkoo.com/201 ...
- Mysql安装错误:Install/Remove of the Service Denied!解决办法
Mysql安装错误:Install/Remove of the Service Denied!解决办法 在windos 的cmd下安装mysql 在mysql的bin目录下面执行: mysqld -- ...
- intel webrtc 部署
org link conference server Configure the MCU server 1. set the maximum numbers of open files, runnin ...
- C++进程间通信之共享内存
转载:http://blog.csdn.net/taily_duan/article/details/51692999 转载:http://blog.csdn.net/fengrx/article/d ...
- Navicat for MySQL安装工具及破解工具
链接: http://pan.baidu.com/s/1i500eEh 密码: 9s26
- 配置Jenkins 实现自动发布maven项目至weblogic(svn+maven+weblogic12c)
Jenkins安装完成之后,需要我们对其配置,然后才可以实现自动部署项目. 前提 防火墙开放weblogic的7001端口 Linux(CentOS):firewall-cmd --zone=publ ...
- How to check if one path is a child of another path?
How to check if one path is a child of another path? Unfortunately it's not as simple as StartsWith. ...
- P2519 [HAOI2011]problem a
思路 神仙思路,就差一步就能想出来了... 看到第i个人给出的条件,发现有\(a_i\)个大于,\(b_i\)个小于并不好处理 考虑把条件转化成第i个人对应的排名处理,设第i个人的排名为\(a_i+1 ...
- 论文笔记:A Review on Deep Learning Techniques Applied to Semantic Segmentation
A Review on Deep Learning Techniques Applied to Semantic Segmentation 2018-02-22 10:38:12 1. Intr ...