centos6.5 64bit
Install Epel, refer to this blog post I turn
http://blog.csdn.net/defeattroy/article/details/45440051
[[email protected] ~]# Yum update
[email protected] ~]# Yum install Docker-io
[[Email protected] ~]# service Docker start
[[email protected] ~]# Chkconfig Docker on
[email protected] ~]# Docker pull CentOS
Pulling Repository CentOS
Fd44297e2ddb:download Complete
6941bfcbbfca:download Complete
41459f052977:download Complete
status:downloaded newer image for Centos:latest
[email protected] ~]# Docker images CentOS
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
CentOS latest Fd44297e2ddb days ago 215.7 MB
CentOS Centos7 fd44297e2ddb days ago 215.7 MB
CentOS 7 fd44297e2ddb days ago 215.7 MB
[email protected] ~]# uname-a
Linux 172.16.18.20 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 03:15:09 UTC x86_64 x86_64 x86_64 gnu/linux
[Email protected] ~]# cat/etc/redhat-release
CentOS Release 6.6 (Final)
[email protected] ~]# Docker run-i-T Centos/bin/bash
[email protected]/]# cat/etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[Email protected]/]# uname-a
Linux da69b38a7e5f 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 03:15:09 UTC x86_64 x86_64 x86_64 gnu/linux
You can see that the distribution is not the same as the kernel after entering the container (yellow) (blue)
Reference:
https://docs.docker.com/installation/centos/#starting-the-docker-daemon
--------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------
Centos
Docker is supported on the following versions of CentOS:
- CentOS 7 (64-bit)
- CentOS 6.5 (64-bit) or later
These instructions is likely work for other binary compatible EL6/EL7 distributions such as scientific Linux, but they ha Ven ' t been tested.
Please note this due to the current Docker limitations, Docker was able to run with only on thebit architecture.
Kernel Support
Currently the CentOS project would only have support for Docker when running on kernels shipped by the distribution. There is kernel changes which would cause issues if one decides to step outside that box and run Non-distribution kernel p Ackages.
To run Docker in CentOS-6.5 or later, you'll need kernel version 2.6.32-431 or higher as this have specific kernel fixes To allow Docker to run.
Installing docker-centos-7
Docker is included by default in the Centos-extras repository. To install run the following command:
$ sudo yum install docker
Please continue with the starting the Docker daemon.
FirewallD
CentOS-7 introduced Firewalld, which is a wrapper around iptables and can conflict with Docker.
When firewalld
was started or restarted it would remove DOCKER
the chain from iptables, preventing Docker from working properly.
When using SYSTEMD, was firewalld
started before Docker, but if you start or restart after Docker, you'll have firewalld
the to Restar t the Docker daemon.
Installing docker-centos-6.5
For CentOS-6.5, the Docker package was part of Extra Packages for Enterprise Linux (EPEL) repository, a community effort to Create and maintain additional packages for the RHEL distribution.
Firstly, you need to ensure the EPEL repository enabled. Please follow Theepel installation instructions.
For CentOS-6, there are a package name conflict with a system tray application and their executable, so the Docker RPM packag E was called docker-io
.
docker-io
to proceed with installation in CentOS-6, you may need to remove the package first docker
.
$ sudo yum -y remove docker
Next, let's install the package docker-io
which would install Docker on our host.
$ sudo yum install docker-io
Please continue with the starting the Docker daemon.
Manual installation of latest Docker release
While using a, the recommended-the-installing Docker, the above package might not being the current release vers Ion. If you need the latest version,you can install the binary directly.
When installing the binary without a package, you may want to integrate Docker with SYSTEMD. For this, install the both unit files (service and socket) fromthe GitHub repository to /etc/systemd/system
.
Please continue with the starting the Docker daemon.
Starting the Docker daemon
Once Docker is installed, you'll need to start the Docker daemon.
$ sudo service docker start
If we want Docker to start at boot, we should also:
$ sudo chkconfig docker on
Now let's verify that Docker is working. First we ' ll need to get the latest centos
image.
$ sudo docker pull centos
Next we'll make sure. We can see the image by running:
$ sudo docker images centos
This should generate some output similar to:
$ sudo docker images centosREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEcentos latest 0b443ba03958 2 hours ago 297.6 MB
Run a simple bash shell to test the image:
$ sudo docker run -i -t centos /bin/bash
If everything is working properly, you'll get a simple bash prompt. Type to exit
continue.
Custom Daemon Options
If you need to add an HTTP Proxy, set a different directory or partition for the Docker runtime files, or make other custo Mizations, read our SYSTEMD article-Learn how tocustomize your Systemd Docker daemon options.
Dockerfiles
The CentOS Project provides a number of sample dockerfiles which you could use either as templates or to familiarize Yoursel F with Docker. These templates is available on GitHub athttps://github.com/centos/centos-dockerfiles
done! You can either continue with the Docker, User Guide, or explore and build on the images yourself.
Docker's so hot, I want to play centos6.5.