设为首页 加入收藏

TOP

阿里云Ubuntu12.464位安装docker
2015-07-24 12:13:44 来源: 作者: 【 】 浏览:77
Tags:阿里 Ubuntu12.464 安装 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,到这里我们的安装算是完成了。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇dump浅析B树索引 下一篇如何解决存储过程中关联临时表时..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: