a. 公司内部都是通过代理上网

    b. 系统为ubuntu 12.04 64位

    c. ESXi 平台


  1. 环境整理

    ifconfig eth0 192.168.18.237 netmask 255.255.255.0 gateway 192.168.18.254

    ifconfig eth0 hw ether 00:0c:29:3b:2a:72

    ### http 代理

    export http_proxy="http://192.168.21.248:3128/"

    ### apt 代理

    echo 'Acquire::http::Proxy "http://192.168.21.248:3128";' > /etc/apt/apt.conf


  2. docker 安装

    由于linux容器的bug,docker在linux的kernel3.8上运行最佳,由于12.04的内核是3.2kernel,所以我们必须,如果你不确定你的内核或者你只是装在virbox上使用,你可以跳过这些步骤

#安装内核
sudo apt-get update
sudo apt-get install linux-p_w_picpath-generic-lts-raring linux-headers-generic-lts-raring

#重启
sudo reboot

第一次添加Docker的repository到你的本地秘钥库

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\    >/etc/apt/sources.list.d/docker.list"    sudo apt-get update    sudo apt-get install lxc-docker

下载ubuntu 镜像

sudo docker pull ubuntu

运行hello world

sudo docker run ubuntu /bin/echo hello world
hello world


下载镜像报错如下,由于内网限制造成

sudo docker pull ubuntu  
Pulling repository ubuntu
2014/10/20 15:37:24 Get https://index.docker.io/v1/repositories/library/ubuntu/p_w_picpaths: dial tcp 
162.242.195.84:443: no route to host

解决方法:

vi /etc/default/docker
### 打开代理
export http_proxy="http://192.168.21.248:3128/"