sudo apt update #更新本地的包索引。
sudo apt upgrade -y #升级已安装的软件包。
lsb_release -a #查看操作系统的版本信息。
sudo apt install apt-transport-https ca-certificates curl software-properties-common #安装一些必需的工具和软件包。
wget https://download.docker.com/linux/ubuntu/gpg #下载 Docker 的 GPG 公钥。
sudo apt-key add gpg #将下载的 GPG 公钥添加到系统的 APT 密钥环中。
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" #将 Docker 官方的 APT 仓库添加到系统的软件源中,使用阿里云的镜像源。
sudo apt install docker-ce #安装 Docker Community Edition(CE)。
sudo systemctl status docker #检查 Docker 服务的状态。