内核要求至少 3.8.0版本或以上. https://docs.docker.com/linux/
第二步要安装epel库
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm sudo rpm -Uvh epel-release-6-8.noarch.rpm
此时,会在/etc/yum.repo.d/目录里生成两个文件epel.repo epel-testing.repo.
默认情况下epel.repo已经启用了enabled=1.
========================================
这里我用的centos7.0 x64的系统。
安装前需要安装相对应的epel库,我用的 Centos 7.0的系统。
$ wget http://ftp.sjtu.edu.cn/fedora/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm $ sudo rpm -Uvh epel-release-7-0.2.noarch.rpm $ ls /etc/yum.repos.d/ CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Sources.repo CentOS-Vault.repo epel.repo epel-testing.repo
Next, let’s install the docker-io
package which will install Docker on our host.
$ sudo yum install docker-io
Now that it’s installed, let’s start the Docker daemon.
$ sudo service docker start
[sudo] password for sysadmin:
Redirecting to /bin/systemctl start docker.service
If we want Docker to start at boot, we should also:
$ sudo chkconfig docker on
Note: Forwarding request to ‘systemctl enable docker.service’.
ln -s ‘/usr/lib/systemd/system/docker.service’ ‘/etc/systemd/system/multi-user.target.wants/docker.servic
Now let’s verify that Docker is working. First we’ll need to get the latest centos
image.
$ sudo docker pull centos:latest
Next we’ll make sure that we can see the image by running:
$ sudo docker images centos
This should generate some output similar to:
$ sudo docker images centos
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos latest 0b443ba039582 hours ago 297.6 MB
Run a simple bash shell to test the image:
$ sudo docker run -i -t centos /bin/bash
bash-4.2#
If everything is working properly, you’ll get a simple bash prompt. Type exit to continue.
Done! You can either continue with the Docker User Guide or explore and build on the images yourself.
Issues?
If you have any issues – please report them directly in the CentOS bug tracker.
官方安装文档:http://docs.docker.com/installation/centos/
官方docker使用手册:http://docs.docker.com/userguide/ (中文手册:http://www.docker.org.cn/book/docker.html )