分享

ubuntu centos 安装docker

desehawk 发表于 2014-8-31 16:39:29 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 10741
问题导读:

1.ubuntu14.04安装docker的步骤是什么?
2.ubuntu12.04如何安装docker?
3.centos6\7系列安装docker包含哪些步骤?










ubuntu14.04安装docker原文地址:https://docs.docker.com/installation/ubuntulinux/
Ubuntu Trusty comes with a 3.13.0 Linux kernel, and a docker.io package which installs Docker 0.9.1 and all its prerequisites from Ubuntu's repository.Note: Ubuntu (and Debian) contain a much older KDE3/GNOME2 package called docker, so the package and the executable are called docker.io.

  1. $ sudo apt-get update
  2. $ sudo apt-get install docker.io
  3. $ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
  4. $ sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io
复制代码



如果使用操作系统自带包安装docker  ,使用上面的办法,安装的版本是0.9.1 (不建议,因为1.0 生产版本已经发布,下面介绍安装方法)

f you'd like to try the latest version of Docker:
First, check that your APT system can deal with https URLs: the file /usr/lib/apt/methods/httpsshould exist. If it doesn't, you need to install the package apt-transport-https.


如果要安装最新的docker版本,那么需要安装https支持
  1. apt-get install apt-transport-https
复制代码

  1. $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
复制代码
  1. $ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main\
  2. > /etc/apt/sources.list.d/docker.list"
  3. $ sudo apt-get update
  4. $ sudo apt-get install lxc-docker
复制代码




这样就安装完毕了。
ubuntu12.04安装docker如果是更低版本的ubuntu
  1. $ sudo apt-get update
  2. $ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
  3. # reboot
  4. $ sudo reboot
复制代码




然后重复上面的步骤即可


centos6\7系列安装docker原文地址:https://docs.docker.com/installation/centos/

CentOS
The Docker package is available via the EPEL repository. These instructions work for CentOS 6 and later. They will likely work for other binary compatible EL6 distributions such as Scientific Linux, but they haven't been tested.
Please note that this package is part of Extra Packages for Enterprise Linux (EPEL), a community effort to create and maintain additional packages for the RHEL distribution.
Also note that due to the current Docker limitations, Docker is able to run only on the 64 bit architecture.
To run Docker, you will need CentOS6 or higher, with a kernel version 2.6.32-431 or higher as this has specific kernel fixes to allow Docker to run.
使用EPEL软件仓库可以安装docker,版本必须在centos6 以后
如果是centos7
下载并安装这个软件包
wget http://mirror.hust.edu.cn/epel/b ... se-7-0.2.noarch.rpm

rpm -ivhepel-release-7-0.2.noarch.rpm
如果是centos6

wget http://mirrors.hustunique.com/ep ... ease-6-8.noarch.rpm
rpm -ivhepel-release-6-8.noarch.rpm
  1. yum install docker-io
复制代码




用上面这个命令安装就可以了
如果之前的系统中存在docker这个软件,最好先删除掉这个包,一个老旧的包
  1. $ service docker start
复制代码


  1. $ chkconfig docker on
复制代码












已有(1)人评论

跳转到指定楼层
hochikong 发表于 2014-9-5 18:47:22
本帖最后由 hochikong 于 2014-9-5 22:09 编辑

本人测试了0.9.1版,遇到几个问题,升级到1.2.0解决了(可以参考下我写的这篇blog:http://my.oschina.net/hochikong/blog/306361)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条