zoukankan      html  css  js  c++  java
  • Docker

    自己创建Image会有一些好处,可以选择最新的版本,而且从国内的镜像创建时更新软件也会从该镜像获取,速度更快。

    (1)安装debootstrap

    zhouh1@uhome:/media/zhouh1/databak/docker$ sudo apt-get install debootstrap 
    Reading package lists... Done
    。。。。。。。

    以下为关于这个包的介绍

    Description: Bootstrap a basic Debian system
     debootstrap is used to create a Debian base system from scratch, without requiring the availability of dpkg or apt. It does this by downloading .deb files from a mirror site,
     and carefully unpacking them into a directory which can eventually be chrooted into.

    (2)创建基础系统

    zhouh1@uhome:/mnt/data/docker$ sudo debootstrap trusty trusty http://mirrors.163.com/ubuntu/
    I: Retrieving Release 
    I: Retrieving Release.gpg 
    I: Checking Release signature
    I: Valid Release signature (key id 790BC7277767219C42C86F933B4FE6ACC0B21F32)
    I: Retrieving Packages 
    。。。。。。。。。。
    。。。。。。。。。。
    I: Configuring rsyslog...
    I: Configuring kbd...
    I: Configuring ubuntu-minimal...
    I: Configuring libc-bin...
    I: Configuring initramfs-tools...
    I: Base system installed successfully

    (3)导入到docker

    zhouh1@uhome:/mnt/data/docker/trusty$  sudo tar -c . | sudo docker import - trusty
    b769d49299800c7984036f3afdd73aa8f0f8f8d6bd8dd0c45c267ecabd04cb08

    (4)测试

    zhouh1@uhome:/mnt/data/docker/trusty$ sudo docker run -i -t trusty /bin/bash
    root@2d66c560066c:/# test
    root@2d66c560066c:/# echo
    
    root@2d66c560066c:/# exit
  • 相关阅读:
    Attribute+Reflection,提高代码重用
    类型安全的EventHandlerList
    简单一招,使解决方案下的项目版本号统一
    T-SQL 随机返回特定行数据和分页查询
    2013年中国系统架构师大会随想
    C#实现在注册表中保存信息
    滤镜
    蒙版
    图层样式和混合模式
    布尔运算
  • 原文地址:https://www.cnblogs.com/utopiazh/p/docker_image.html
Copyright © 2011-2022 走看看