阿里云Ubuntu 12.4 64位 安装docker

最近大家都在说docker,索性自己阿里云买了台ubuntu完,这里需要注意的是,docker的官方文档中有提到,docker目前只对64的系统有支持。

所以这里我选择的是ubuntu 12.04 64位.

由于linux容器的bug,docker在linux的kernel3.8上运行最佳。

看下我们的ubuntu版本命令:

root@iZ94742n0oaZ:~# cat /etc/issue

Ubuntu 12.04.5 LTS \n \l


再来看下内核,命令:

root@iZ94742n0oaZ:~# uname -r

3.2.0-67-generic



很不幸我的内核版本没有达到官方要求,没关系,我们接下来用下面的命令升级内核:

sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
sudo apt-get install --install-recommends linux-generic-lts-raring xserver-xorg-lts-raring libgl1-mesa-glx-lts-raring
注意:升级后需要重启ubuntu.
#重启
sudo reboot


现在我们的环境都准备好,接下来我们要正式的安装部署docker.

首先我们要更新apt-get的安装源

root@iZ94742n0oaZ:~# vi /etc/apt/sources.list

删除里面的所有内容,把下面的安装源写入


deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

然后更新apt-get

root@iZ94742n0oaZ:~#apt-get update


root@iZ94742n0oaZ:~#apt-get install docker.io

root@iZ94742n0oaZ:~# service docker.io restart

接下来我们启动docker

root@iZ94742n0oaZ:~#docker run -i -t ubuntu /bin/bash

Cannot connect to the Docker daemon. Is 'docker -d' running on this host?


root@iZ94742n0oaZ:~#docker run -i -t ubuntu /bin/bash
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

root@iZ28ikebrg6Z:~# docker -d

出现如下错误:
root@iZ28ikebrg6Z:~# docker -d
Could not find a free IP address range for interface 'docker0'. Please configure its address manually and run 'docker -b docker0'

然后我们只需要输入:
root@iZ94742n0oaZ:~#sudo route del -net 172.16.0.0 netmask 255.240.0.0

注意这里,每次重启后都要执行上面这条命令,制定子网掩码。

root@iZ94742n0oaZ:~# docker -d

2015/04/10 15:09:43 docker daemon: 1.0.1 990021a; execdriver: native; graphdriver: 

[377a9034] +job serveapi(unix:///var/run/docker.sock)

[377a9034] +job initserver()

[377a9034.initserver()] Creating server

2015/04/10 15:09:43 Listening for HTTP on unix (/var/run/docker.sock)

[377a9034] +job init_networkdriver()

[377a9034.init_networkdriver()] creating new bridge for docker0

[377a9034.init_networkdriver()] getting iface addr

[377a9034] -job init_networkdriver() = OK (0)

Loading containers: : done.

[377a9034.initserver()] Creating pidfile

[377a9034.initserver()] Setting up signal traps

[377a9034] -job initserver() = OK (0)

[377a9034] +job acceptconnections()

[377a9034] -job acceptconnections() = OK (0)

ok,到这里我们的安装算是完成了。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值