本篇文章对应之前写的Ubuntu系统环境搭建(三)——Ubuntu安装Docker,是对这篇文章的纠正,这一篇是最新版的搭建手册,请以这一篇为准!
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl status docker
sudo systemctl start docker
sudo systemctl enable docker
sudo docker version
sudo docker run hello-world
最新版的docker自带Docker Compose
sudo docker compose version