最小的界面linux系统,如何制作最简单和最小的Linux系统

1、光盘挂载

mount /dev/cdrom /mnt/

2、安装febootstrap命令

yum install febootstrap

3、制作镜像目录

febootstrap -i bash  -i yum  centos6 centos6.4_base file:///mnt/

4、将locale-archive文件进行缩减,原有98M,之后1.6M

cp /usr/lib/locale/locale-archive /tmp/

rm -fv /usr/lib/locale/locale-archive && localedef -f UTF-8 -i zh_CN zh_CN.UTF8 && localedef --list-archive

cp /usr/lib/locale/locale-archive centos6.4_base/usr/lib/locale/

[root@localhost  ~]# cp -a /root/.bash* centos6.4_base/root/

[root@localhost  ~]# du -sh centos6.4_base/

49M     centos6.4_base/

[root@localhost  ~]# cd centos6.4_base/ && tar -c .|docker import - centos6.4_min

e42236cce673a646a7613d952070fed1f00faed2ce00638d1ad4364deb0f6c73

[root@localhost  centos6.4_base]# docker images

REPOSITORY                            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

centos6.4_min                         latest              e42236cce673        9 seconds ago       38.14 MB

centos6.4                             nginx_2             9d1fb16633da        15 hours ago        1.032 GB

www.perofu.com:8080/centos6.4_nginx   latest              9292ea856521        15 hours ago        1.032 GB

centos6.4                             nginx_1             9292ea856521        15 hours ago        1.032 GB

centos6.4                             nginx               9426c7d004a6        16 hours ago        1.032 GB

centos6.4                             latest              8629503fccf6        16 hours ago        795.9 MB

registry                              latest              985e98f8266b        5 months ago        404.7 MB

[root@localhost  centos6.4_base]# docker run -it --rm centos6.4_min /bin/bash

[root@68e616e37a6d /]# ls

bash: ls: command not found

[root@68e616e37a6d /]# cd

[root@68e616e37a6d ~]# ls

bash: ls: command not found

[root@68e616e37a6d ~]# ll /bin/

bash: ll: command not found

[root@68e616e37a6d ~]#

[root@68e616e37a6d ~]# ls /bin/

bash: ls: command not found

[root@68e616e37a6d ~]# pwd

/root

[root@68e616e37a6d ~]#

Display all 113 possibilities? (y or n)

!                          command                    exit                       iconvconfig                read                       times

./                         compgen                    export                     iconvconfig.x86_64         readarray                  trap

:                          complete                   false                      if                         readonly                   true

[                          compopt                    fc                         in                         return                     type

[[                         continue                   fg                         jobs                       rm                         typeset

]]                         coproc                     fi                         kill                       rpcgen                     tzdata-update

alias                      cp                         for                        ldconfig                   select                     tzselect

bash                       declare                    function                   ldd                        set                        ulimit

bashbug-64                 dirs                       gencat                     let                        setcap                     umask

bg                         disown                     getcap                     local                      sh                         unalias

bind                       do                         getconf                    locale                     shift                      unset

break                      done                       getent                     localedef                  shopt                      until

build-locale-archive       echo                       getopts                    logout                     sln                        wait

builtin                    elif                       getpcaps                   mapfile                    source                     while

caller                     else                       glibc_post_upgrade.x86_64  mv                         sprof                      zdump

capsh                      enable                     hash                       popd                       suspend                    zic

case                       esac                       help                       printf                     test                       {

catchsegv                  eval                       history                    pushd                      then                       }

cd                         exec                       iconv                      pwd                        time

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值