【个人亲试最新】WSL2中的Ubuntu 22.04安装Docker


😊点此到文末惊喜↩︎


Wsl2中的Ubuntu22.04安装Docker

确定为wsl2+ubuntu22.04,若按照以下步骤失败,请重装ubuntu22.04

  1. 安装依赖包
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release
  1. 添加阿里云镜像源和密钥
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  1. 添加阿里云镜像源
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  1. 从软件源中更新安装工具包
sudo apt update
  1. 安装Docker套件
sudo apt install docker-ce docker-ce-cli containerd.io
  1. 配置Docker镜像源
    • 配置阿里云需要注册,并在 阿里云个人镜像源网址 中获取个人镜像源
    • 其他镜像加速地址如8. 其他镜像源加速地址所示
1.创建Docker文件夹
sudo mkdir -p /etc/docker
2.写入个人镜像源
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://要写入的镜像源.cn"]
}
EOF
3.重启守护进程和docker引擎
sudo systemctl daemon-reload
sudo systemctl restart docker
  1. 测试镜像源配置成功
sudo docker pull hello-world

成功截图
在这里插入图片描述
8. 其他镜像源加速地址

名称地址
Docker 中国官方镜像https://registry.docker-cn.com
DaoCloud 镜像站http://f1361db2.m.daocloud.io
Azure 中国镜像https://dockerhub.azk8s.cn
科大镜像站https://docker.mirrors.ustc.edu.cn
阿里云https://ud6340vz.mirror.aliyuncs.com
七牛云https://reg-mirror.qiniu.com
网易云(常用)https://hub-mirror.c.163.com
腾讯云https://mirror.ccs.tencentyun.com

其他问题

wsl中执行Ubuntu 报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.

  1. https://www.zhihu.com/question/535145130
  2. https://zhuanlan.zhihu.com/p/567924469


少年,我观你骨骼清奇,颖悟绝伦,必成人中龙凤。
不如点赞·收藏·关注一波


🚩点此跳转到首行↩︎

参考博客

  1. ubuntu上使用阿里镜像源安装docker
  2. Docker配置阿里云加速器(2续)
  3. 待定引用
  4. 待定引用
  5. 待定引用
  6. 待定引用
  7. 待定引用
  8. 待定引用
  • 12
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

逆羽飘扬

如果有用,请支持一下。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值