0
点赞
收藏
分享

微信扫一扫

Ubuntu 22.04 安装docker

Silence潇湘夜雨 2023-02-09 阅读 124

1.先卸载旧版,如果没有的话,就不用执行了,直接第二步。

apt-get remove docker docker-engine docker.io containerd runc

2.在终端输入

apt update
apt-get install ca-certificates curl gnupg lsb-release

3.安装证书

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

4.写入软件源信息

sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

5.安装

sudo apt-get install docker-ce docker-ce-cli containerd.io

中途出现问题的话,使用  sudo apt-get update 试试

6 启动Docker

systemctl start docker

7.安装工具

apt-get -y install apt-transport-https ca-certificates curl software-properties-common

8.重启docker

service docker restart

9.测试输入sudo docker run hello-world 显示以下信息则成功,第一次比较慢。

sudo docker run hello-world

10.查看版本

sudo docker version

11.查看镜像,可以看到刚才创建的镜像

sudo docker images

完成~



















举报

相关推荐

0 条评论