sdchy 发表于 2018-5-29 12:43:27

docker创建私有镜像

  一、安装febootstrap
  yum –y install febootstrap
  或
  1、下载febootstrap
  http://libguestfs.org/download/febootstrap/
  

  2、安装依赖环境
  yum install ocaml ocaml-foo-devel ocaml-camlp4-devel ocaml-ocamldoc ocaml-findlib-devel ocaml-extlib-devel ocaml-calendar-devel e2fsprogs-devel glibc-static
  

  3、执行安装
  mkdir -p /usr/local/febootstrap && cd /usr/local/febootstrap && ./configure --prefix=/usr/local/febootstrap && make && make install
  

  

  二、执行以下命令镜像制作镜像

  febootstrap -i bash -i wget -i yum -i vi -i gzip -i vixie-cron -i ntpdate centos6 centos6.7-image http://mirrors.aliyun.com/centos/6.7/os/x86_64/
  centos6:OS版本。
  centos6.7-image:镜像文件保存到当前路径下的centos6.7-image文件夹下。
  http://mirrors.aliyun.com/centos/6.7/os/x86_64/ : centos6.3系统镜像路径。
  上面的-i选项表明我制作的基础镜像中已经包含的一些包,需要什么包可以在下面的地址中查找               到http://mirrors.aliyun.com/centos/6.7/os/x86_64/,由于URL的地址都是在墙外面可能会造成制作过程异常的慢,在此使用阿里云源
  

  三、导入镜像文件
  cd centos6.7-image && tar -c .|docker import - centos6.7-base
  

  四、查看镜像
  docker images
  

  



附件:http://down.51cto.com/data/2367362
页: [1]
查看完整版本: docker创建私有镜像