当前位置:   article > 正文

Docker学习 - Ubuntu镜像启动使用(换阿里镜像源)_ubuntu22 docker 设置阿里云镜像

ubuntu22 docker 设置阿里云镜像

Ubuntu系统

阿里云镜像源官方配置: https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11PKzYs6

清华镜像源官方配置: https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

方式1 - 切换apt-阿里镜像源

/www/server/sources.list


deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

docker pull ubuntu

# 设置apt为阿里镜像源
docker run -v /www/server/sources.list:/etc/apt/sources.list --name ubuntu  -it ubuntu:latest  /bin/bash

# 更新软件列表
apt update

# 安装vim编辑器
apt -y install vim

# 安装ifconfig命令
apt -y install net-tools
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
方式2 - 默认apt-ubuntu镜像源
docker pull ubuntu

docker run  --name ubuntu  -it ubuntu:latest  /bin/bash
  • 1
  • 2
  • 3

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/605509
推荐阅读
相关标签
  

闽ICP备14008679号