Linux CentOS系统
1、更新yum
yum update
如果出现:Could not resolve host 错误
先试试能不能ping通IP,如果可以只要设置一下DNS就行了
vi /etc/resolv.conf
然后添加:
nameserver 8.8.8.8
2、安装软件包:
yum-utils yum-config-manager
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、安装Docker引擎
yum install docker-ce docker-ce-cli containerd.io
4、安装验证:
// 拉取镜像
sudo docker pull hello-world
// 执行hello-world
sudo docker run hello-world
如果执行结果如下,则安装成功:
docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.