注意:docker版本和centos之间有对应关系,centos7.6.1810可以安装docker20.10.6
centos 系统要求:
image.png
docker version:
image.png
对时:
yum install ntpdate -y
ntpdate cn.pool.ntp.org
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
docker安装:
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
systemctl start docker
docker run hello-world
问题处理:
docker-compose: command not found:
下载docker-compose:
https://docs.docker.com/compose/install/
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
网友评论