centos7.8安装docker及docker-compose

前段时间需要部署生产环境的docker环境,现把积累的分享给有需要的童鞋:

安装docker(2核8G配置,centos7.8)

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 list docker-ce --showduplicates | sort -r

Docker 版本为 18.x+

yum install docker-ce-18.06.3.ce
systemctl start docker
systemctl enable docker
systemctl status docker
docker -v

测试运行 hello-world,打印后自动退出

docker run hello-world

安装docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose -v

参考文章:
https://www.cnblogs.com/ilykaihui/p/14438873.html
https://blog.csdn.net/qq_40401866/article/details/106925749
https://www.cnblogs.com/morgan363/p/11813092.html

你可能感兴趣的:(docker&k8s,docker,linux)