官方文檔網址: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