赞
踩
提示:本文以 Ubuntu22.04为例安装Docker
提示:以下是本篇文章正文内容,下面案例可供参考
注:docker的旧版本不一定被称为docker,http://docker.io 或 docker-engine也有可能
- 所以我们卸载的命令为:
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt update
sudo apt upgrade
sudo apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
注:该命令需要使用root权限
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
注:重新登录才能使更改生效
sudo docker version
systemctl start docker
systemctl status docker
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
service docker restart
sudo docker run hello-world
sudo docker images
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。