Installing Docker on CentOS/RHEL

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

Customer Advisory

A 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 either use RedHat’s fork of Docker 1.13 or Docker CE/EE 18.09.1 or later, neither of which are affected by the bug.

Another kmem bug was introduced into version 1.2.10-3.2 of the package containerd.io which can affect any version of Docker. Mesosphere DC/OS customers and community members who utilize RedHat or CentOS as their base operating systems are strongly advised to avoid this version.

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

Requirements and Recommendations

Be sure that Docker’s live-restore setting is disabled. It should be absent or set to false in a Docker configuration file.

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.

  1. Uninstall the newer version of Docker (if present):

    sudo yum remove docker-ce
    
  2. Install Docker:

    sudo yum install docker
    
  3. Start Docker:

    sudo systemctl start docker
    
  4. 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.