安装前检查
-
内核版本
uname -a -
检查Device Mapper
ls -l /sys/class/misc/device-mapper
由于Docker是基于Linux内核的。如不满足,则需要升级内核版本。
安装过程
- yum install curl
- curl -sSL https://get.daocloud.io/docker | sh
- systemctl daemon-reload
- systemctl restart docker.service
查看版本
docker version
将用户添加至docker的用户组
- sudo groupadd docker
- sudo gpasswd -a ${USER} docker
- sudo service docker restart
拉取一个镜像
docker pull centos:centos7
实现hello world
docker run centos:centos7 echo ‘hello world’