koill 发表于 2015-10-13 07:26:39

ubuntu centos 安装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.

$ sudo apt-get update
$ sudo apt-get install docker.io
$ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
$ 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支持
apt-get install apt-transport-https
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main\
> /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker
这样就安装完毕了。
ubuntu12.04安装docker

如果是更低版本的ubuntu

$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
# reboot
$ 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/beta/7/x86_64/epel-release-7-0.2.noarch.rpm


rpm -ivh

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



wget http://mirrors.hustunique.com/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh

epel-release-6-8.noarch.rpm

yum install docker-io
用上面这个命令安装就可以了
如果之前的系统中存在docker这个软件,最好先删除掉这个包,一个老旧的包

$ service docker start
$ chkconfig docker on
页: [1]
查看完整版本: ubuntu centos 安装docker