docker安装

docker安装

前期检查
系统版本大于等于centos/redhat7.5,因为我们要使用overlay2的存储,具体原因,后面再说。
内核版本大于等于3.10。

[root@node7 ~]# uname -r
3.10.0-862.el7.x86_64
[root@node7 ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[root@node7 ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 

添加repo仓库
这里我们选择阿里云的镜像源,速度比较快

[root@node7 ~]# cat /etc/yum.repos.d/docker-ce.repo 
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg

安装

yum install -y docker-ce

配置加速器
注册阿里云账号,可以获得免费的镜像加速功能,docker-ce的配置文件为/etc/docker/daemon.json,是一个json类型的文件,通过配置该文件,我们就可以修改docker。

[root@node7 ~]# cat /etc/docker/daemon.json 
{
  "registry-mirrors": ["https://xxxxxxxxx.mirror.aliyuncs.com"]
}

启动

[root@node7 ~]# systemctl restart docker
[root@node7 ~]# docker info
Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local ##存储插件
  Network: bridge host ipvlan macvlan null overlay  ##支持的网络插件
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog  ##日志
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 r
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值