安裝
卸載舊版本
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
設(shè)置存儲(chǔ)庫(kù)
$ sudo yum install -y yum-utils
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
安裝
1.安裝最新版本的Docker Engine和容器
$ sudo yum install docker-ce docker-ce-cli containerd.io
2.啟動(dòng)Docker
$ sudo systemctl start docker
3.測(cè)試
$ sudo docker run hello-world
4.卸載
$ sudo yum remove docker-ce docker-ce-cli containerd.io
$ sudo rm -rf /var/lib/docker
下載Compose
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
授權(quán)
$ sudo chmod +x /usr/local/bin/docker-compose
測(cè)試
$ docker-compose --version
若已安裝python呈枉,也可通過(guò)pip進(jìn)行安裝
pip install docker-compose
pip uninstall docker-compose