本文最后更新于 441 天前,其中的信息可能已经有所发展或是发生改变。
安装Docker
sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" apt-cache policy docker-ce sudo apt install docker-ce sudo systemctl status docker
安装Docker Compose
#自行替换版本号 sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version
其中第一行命令的版本号需要根据Github的最新版本进行替换:链接
卸载Docker
#删除docker rm -rf /etc/docker rm -rf /run/docker rm -rf /var/lib/dockershim rm -rf /var/lib/docker ps -ef|grep docker kill -9 pid yum list installed | grep docker yum remove 所列出的所有包 docker version #查看Docker是否还在