参考:https://www.cnblogs.com/caoweixiong/p/12186736.html
我的是在centos7系统下进行的安装
步骤一:
检测内核版本
uname -r
检测是否有device-mapper
ls -l /sys/class/misc/device-mapper
没有请安装
yum install -y device-mapper
加载
modprobe dm_mod
步骤二
安装
yum -y install gcc yum -y install gcc-c++ yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum makecache fast yum list docker-ce.x86_64 --showduplicates | sort -r yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io yum install docker-ce-18.09.9 docker-ce-cli-18.09.9 containerd.io
启动
systemctl start docker
systemctl status docker
步骤三
检测
docker version
docker search tomcat
查看镜像、下载镜像、运行镜像
docker images docker pull centos docker run centos echo "hello"
步骤四
配置daemon.json文件,在内添加镜像加速
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://hub-mirror.c.163.com"]
}
配置完后进行加载daemon,重启docker
systemctl daemon-reload
systemctl restart docker