Installing Docker on CentOS/RHEL

Requirements, recommendations and procedures for installing Docker CE on CentOS/RHEL

Customer Advisory

A recently discovered bug in Docker 17.x’s handling of cgroups kernel memory controller (kmem) causes instability for the entire system when the kmem accounting feature is activated. Customers may notice tasks or commands getting stuck indefinitely and kernel-related error messages in the system logs. Mesosphere DC/OS customers and community members who utilize RedHat or CentOS as their base operating systems are strongly advised to install and use RedHat’s fork of Docker 1.13. This fork of Docker does not require an RHN subscription.

NOTE: More specific details on the Docker bug and mitigation instructions are located here.

Requirements and Recommendations

Before installing Docker on CentOS/RHEL, review the general requirements and recommendations for running Docker on DC/OS and the following CentOS/RHEL-specific recommendations:

  • OverlayFS is now the default in Docker CE. There is no longer a need to specify or configure the overlay driver. Prefer the OverlayFS storage driver. OverlayFS avoids known issues with devicemapper in loop-lvm mode and allows containers to use docker-in-docker, if they want.

  • Format node storage as XFS with the ftype=1 option. As of CentOS/RHEL 7.2, only XFS is currently supported for use as a lower layer file system.

  • For more a more detailed breakdown of installing docker, see the Docker CE for CentOS installation page.

    NOTE: In modern versions of Centos and RHEL, ftype=1 is the default. The xfs_info utility can be used to verify that ftype=1.

    mkfs -t xfs -n ftype=1 /dev/sdc1
    

Installation

RHEL-only requirements

You must register with the subcription-manager to enable additional repos.

Follow the Docker RHEL-specific installation instructions, keeping in mind the above customer advisory.

Example: Installing Docker on CentOS

The following instructions demonstrate how to install Docker on CentOS 7.

Note: Uninstall the newer version of Docker (if present):

```bash
sudo yum remove docker-ce
```
  1. Install Docker:

    sudo yum install docker
    
  2. Start Docker:

    sudo systemctl start docker
    
  3. Verify that Docker version 1.13 was installed:

    docker version --format '{{.Server.Version}}'
    

To continue setting up DC/OS, please jump to the Advanced Installer

For more generic Docker requirements, see System Requirements: Docker.