Linux安装docker
一、CentOS6.10安装docker
1,安装依赖
yum install -y epel-release
2,安装docker
yum install -y docker-io
3,验证
查看是否有这个文件/etc/sysconfig/docker
执行docker version
4,配置阿里云镜像加速器
vim /etc/sysconfig/docker
配置other_args="–registry-mirror=https://xlueywoz.mirror.aliyuncs.com"
验证:ps aux | grep docker
二、 CentOS7.7安装dockers
1,使用uname -r 查看内核版本,版本应当大于3.10;
2,安装yum-utils,此工具包含yum-config-manager,可设定稳定的仓库链接;
$ sudo yum install -y yum-utils
$ sudo yum-config-manager
–add-repo
https://download.docker.com/linux/centos/docker-ce.repo
3,安装最新版本的docker
$ sudo yum install docker-ce docker-ce-cli containerd.io
4,启动docker
$ sudo systemctl start docke
5,下载hello world镜像,测试docker安装正确
$ sudo docker run hello-world
注:详细信息见https://docs.docker.com/engine/install/centos/#install-from-a-package
6,配置阿里云镜像加速器
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
三、验证安装,运行hello-world
运行命令docker run hello-world