Troubleshooting Docker
上QQ阅读APP看书,第一时间看更新

Installing Docker on Red Hat Linux

Docker is supported on Red Hat Enterprise Linux 7.x. This section provides an overview of installation of Docker using Docker-managed release packages and installation mechanisms. Using these packages ensures that you will be able get the latest release of Docker.

Checking kernel version

The Linux kernel version can be checked with the help of the following command:

$ uname -r

The output, in our case, is kernel version 3.10.x, which will work fine:

3.10.0-327.el7.x86 _64

Updating the YUM packages

The YUM repository can be updated, using the following command:

$ sudo yum update

Output listing is given; ensure that it shows Complete! at the end, as follows:

Loaded plugins: amazon-id, rhui-lb, search-disabled-repos rhui-REGION-client-config-server-7 | 2.9 kB .... Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : linux-firmware-20150904-43.git6ebf5d5.el7.noarch 1/138 Updating : tzdata-2016c-1.el7.noarch 2/138 .... Complete! 

Adding the YUM repository

Let's add the Docker repository to the YUM repository list:

$ sudo tee /etc/yum.repos.d/docker.repo <<-EOF [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF

Installing the Docker package

The Docker Engine can be installed using YUM repository, as follows:

$ sudo yum install docker-engine

Starting the Docker service

The Docker service can be started with help of the following command:

$ sudo service docker start
Redirecting to /bin/systemctl start docker.service

Testing the Docker installation

Listing all the processes in the Docker Engine with help of the following command can validate whether the installation of the Docker service is successful or not:

$ sudo docker ps -a

The following is the output for the preceding command:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Check the Docker version to make sure that it is the latest:

$ docker --version Docker version 1.11.0, build 4dc5990

Checking the installation parameters

Let's run Docker information to see the default installation parameters:

$ sudo docker info

The output listing is given here; note that the Storage Driver is devicemapper:

Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 1.11.0 Storage Driver: devicemapper Pool Name: docker-202:2-33659684-pool Pool Blocksize: 65.54 kB Base Device Size: 10.74 GB Backing Filesystem: xfs Data file: /dev/loop0 Metadata file: /dev/loop1 ... Cgroup Driver: cgroupfs Plugins: Volume: local Network: null host bridge Kernel Version: 3.10.0-327.el7.x86_64 Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 991.7 MiB Name: ip-172-30-0-16.ap-northeast-1.compute.internal ID: VW2U:FFSB:A2VP:DL5I:QEUF:JY6D:4SSC:LG75:IPKU:HTOK:63HD:7X5H Docker Root Dir: /var/lib/docker Debug mode (client): false Debug mode (server): false Registry: https://index.docker.io/v1/

Troubleshooting tips

Ensure that you are using the latest version of Red Hat Linux to be able to deploy Docker 1.11. Another important thing to remember is that the kernel version has to be 3.10 or higher. Rest of the installation was pretty uneventful.