官方文档网址:https://docs.docker.com/engine/install/centos/
本文以centos7为例:
打开网址,如图:
根据文档输入命令:
Install using the repository(安装仓库)
$ sudo yum install -y yum-utils
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
INSTALL DOCKER ENGINE(安装引擎)
$ sudo yum install docker-ce docker-ce-cli containerd.io
启动docker
$ sudo systemctl start docker
试着运行一个docker hello-word
sudo docker run hello-world
查看已经有的docker镜像
docker images