0
点赞
收藏
分享

微信扫一扫

Docker——配置Ubuntu,然后玩耍。

非宁静不致远 2022-02-19 阅读 20

文章目录

下载镜像

因为会经常皮坏了,所以要下载下来用。

docker pull ubuntu

启动容器

docker run -d --name linux -i -t ubuntu

阿里镜像

玩耍怎么能用2G网

查看系统版本

在容器中执行

cat /etc/os-release

配置文件导出

docker cp linux:/etc/apt/sources.list /

需要管理员权限的命令行

会出现在C盘根目录下

修改

官方教程:https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11W3dydF

我的是20版本

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

配置文件导入

docker cp /source.list linux:/etc/apt

查看效果

apt-get update

在这里插入图片描述

举报

相关推荐

0 条评论