CentOS 7环境下安装Docker CE

CentOS 7环境下安装Docker CE

严少安 Lv.6

Docker分为社区版和企业版两种版本,下面演示Docker社区稳定版本的安装过程。

环境信息

CentOS 7.4

Linux 3.10.0-693.17.1.el7.x86_64

Docker CE 17.12.0.ce-1.el7.centos

安装 Docker CE

  • check config

安装前对系统资源进行检查

1
2
curl https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh > check-config.sh
bash ./check-config.sh
  • Step1. 安装依赖
1
2
3
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
  • Step2. 添加仓库
1
2
3
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
  • Step3. 安装Docker CE
1
sudo yum install docker-ce
  • Step4. 启用、启动Docker
1
2
3
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl status docker

  • Step5. 运行hello-world镜像
1
sudo docker run hello-world

Reference

  • Title: CentOS 7环境下安装Docker CE
  • Author: 严少安
  • Created at: 2018-02-17 21:01:01
  • Updated at: 2018-02-17 21:01:01
  • Link: https://shawnyan.cn/2018/docker/docker-install-on-centos/
  • License: This work is licensed under CC BY-NC-SA 4.0.
 Comments