京东alexa排名,北京网站优化多少钱,网易游戏官网,百度建设网站今天分享Linux环境之Ubuntu安装docker流程#xff0c;Docker 是目前非常流行的容器#xff0c;对其基本掌握很有必要。下面我们通过阿里云镜像的方式安装#xff1a;
本来今天准备用清华大学镜像安装呢#xff0c;好像有点问题#xff0c;于是改成阿里云安装了。清华安装…今天分享Linux环境之Ubuntu安装docker流程Docker 是目前非常流行的容器对其基本掌握很有必要。下面我们通过阿里云镜像的方式安装
本来今天准备用清华大学镜像安装呢好像有点问题于是改成阿里云安装了。清华安装
docker-ce | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
报错图片: 于是我就改成了阿里云镜像。
阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区
1、进来就看到了Ubuntu 环境安装过程 2、安装准备工作
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository deb [archamd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable
更新Docker-CE
sudo apt-get -y update如果安装的用户是 root 权限就可以不加sudo
3、安装最新版本
apt-get -y install docker-ce
此命令 会让客户端和服务端均安装最新版本。
4、安装指定版本先查找Docker-CE的版本
apt-cache madison docker-ce
然后选择需要安装的版本sudo apt-get -y install docker-ce[VERSION]如下所示
apt-get -y install docker-ce5:24.0.0-1~ubuntu.20.04~focal docker-ce-cli5:24.0.0-1~ubuntu.20.04~focal
注意这里 docker-ce-cli、docker-ce 客户端和服务端均需要指定版本否则版本不一致使用过程中很可能出现问题。
5、查看docker 相关的文件
dpkg -l|grep docker
6、查看docker状态
systemctl status docker.service
7、启动
systemctl start docker.service
8、查看版本和详情 docker versiondocker info
9、删除Docker apt purge docker-cerm -rf /var/lib/docker
10、默认安装
apt -y install docker.io
11、验证是否安装成功
sudo docker run hello-world
12、 设置开机启动
sudo systemctl enable docker
13、重启docker验证是否成功
sudo systemctl daemon-reloadsudo systemctl restart docker
14、单独删除 某个组件比如删除docker客户端
apt remove docker-ce-cli 15、查看操作系统版本二选一
cat /proc/versionlsb_release -a
到此Docker安装分析完毕下篇分享其常用命令和基本使用敬请期待