暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
Docker镜像制作-Ubuntu 20.04 LTS Docker 基础镜像.pdf
218
10页
1次
2022-10-24
5墨值下载
制作Ubuntu 20.04 LTS Docker 基础镜像
环境说明
1. 宿主系统Ubuntu 20.04
2. Docker版本:19.03.14
首先在安装好宿主系统,配置好基础网络环境,切换到root账户下。
安装 debootstrap
debootstrap 构建 Ubuntu 20.04 LTS rootfs
注意: debootstrap 命令中的 --arch=amd64 focal (代表ubuntu 20.04
配置基础系统
修改默认的源
apt install debootstrap
mkdir /home/test/docker/images/ubuntu-20-base -pv
debootstrap --verbose --arch=amd64 focal /home/test/docker/images/ubuntu-20-base
http://mirrors.aliyun.com/ubuntu
# 切换到基础系统中
chroot /home/test/docker/images/ubuntu-20-base /bin/bash
mv /etc/apt/sources.list /etc/apt/sources.list.bak
vi /etc/apt/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
安装基础包
配置字符集为 en_US.UTF-8 UTF-8
打开一个选择语言的窗口,在此窗口中选择环境的字符集项,我选择en_US.UTF-8 UTF-8zh_CN.UTF-
8 UTF-8,即按空格选中复选框,并设置en_US.UTF-8 UTF-8为默认,然后退出登录重新连接就好了。
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
apt -y update && apt -y upgrade && apt -y install vim locales lsof net-tools
htop glances
apt -y install openssh-server rsync
apt -y update && apt -y upgrade && apt -y install vim locales lsof net-tools
htop glances iotop psmisc wget curl
apt -y install openssh-server rsync
apt -y update
# apt -y install vim locales lsof net-tools htop glances iotop psmisc wget curl
apt -y install vim locales lsof net-tools htop iotop psmisc wget curl
apt -y install openssh-server rsync
dpkg-reconfigure locales
echo 'export LC_ALL=C' >> /etc/profile
of 10
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜