centos7 安装 docker 容器

 

本文采用yum install 的方式来安装docker

第一步:安装yum安装配置工具(如果直接可以下载阿里云对应的docker-ce.repo此步骤一、二、三可以省略)

$ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

第二步:生成yum安装docker的配置文件

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

第三步:替换docker-ce.repo 里边的内容,主要目的是解决墙的问题

vi /etc/yum.repos.d/docker-ce.repo

将“https://download-stage.docker.com/”全部替换为“https://mirrors.aliyun.com/docker-ce/”

 第四步:

sudo yum install docker-ce

第五步:验证

[root@node2 ~]# docker info
Containers: 18
 Running: 12
 Paused: 0
 Stopped: 6
Images: 9
Server Version: 18.06.0-ce
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 macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-862.6.3.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.779GiB
Name: node2
ID: SRQ4:AW4N:UD4J:35DZ:UWGH:NIB3:DXLG:EYAJ:IS55:R5WA:UBBD:EMLJ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 https://v341mqs3.mirror.aliyuncs.com/
Live Restore Enabled: false

注:docker相关命令可以自行网上查看
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值