公司动态
Ubuntu20.04上安装docker 保姆级教程
1.卸载旧版本如果之前安装过dockersudoapt-getremovedockerdocker-engine docker.io containerd runc2.更新系统并安装依赖sudoaptupdatesudoaptinstall-yapt-transport-https ca-certificatescurlsoftware-properties-common3.添加GPG密钥与仓库使用国内镜像源如阿里云curl-fsSLhttps://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg|sudoapt-keyadd-sudoadd-apt-repository\deb [archamd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu$(lsb_release-cs)stable4.安装Docker引擎sudoaptupdatesudoaptinstall-ydocker-ce docker-ce-cli containerd.io5.配置镜像加速编辑/etc/docker/daemon.jsonsudovim/etc/docker/daemon.json写入以下内容写入多镜像加速地址{registry-mirrors:[https://docker.m.daocloud.io,https://hub-mirror.c.163.com,https://mirror.baidubce.com,https://docker.nju.edu.cn]}重载系统服务并重启Docker生效sudosystemctl daemon-reloadsudosystemctl restartdocker6.验证安装docker--versionsudodockerrun hello-world可通过以下命令设置开机自启sudosystemctlenabledocker