Docker’s CentOS-specific installation instructions are always going to be the most up to date for the latest version of Docker. However, the following recommendations and instructions should make it easier to manage the Docker installation over time and mitigate several known issues with various other configurations.
In addition to the general Docker requirements and recommendations for DC/OS, the following CentOS-specific recommendations will improve your DC/OS experience.
Use Docker’s yum repository to install Docker on CentOS. The yum repository makes it easy to upgrade and automatically manages dependency installation.
Prefer the OverlayFS storage driver. OverlayFS avoids known issues with
loop-lvmmode and allows containers to use docker-in-docker, if they want.
Use CentOS 7.2 or greater. OverlayFS support was improved in 7.2 to fix a bug with XFS.
Format node storage as XFS with the
ftype=1option. As of CentOS 7.2, “only XFS is currently supported for use as a lower layer file system”.
mkfs -t xfs -n ftype=1 /dev/sdc1
The following instructions demonstrate how to use Docker with OverlayFS on CentOS 7.
Upgrade CentOS to 7.3:
sudo yum upgrade --assumeyes --tolerant sudo yum update --assumeyes
Verify that the kernel is at least 3.10:
uname -r 3.10.0-327.10.1.el7.x86_64
sudo tee /etc/modules-load.d/overlay.conf <<-'EOF' overlay EOF
Reboot to reload kernel modules:
Verify that OverlayFS is enabled:
lsmod | grep overlay overlay
Configure yum to use the Docker yum repo:
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF
Configure systemd to run the Docker Daemon with OverlayFS:
sudo mkdir -p /etc/systemd/system/docker.service.d && sudo tee /etc/systemd/system/docker.service.d/override.conf <<- EOF [Service] ExecStart= ExecStart=/usr/bin/dockerd --storage-driver=overlay EOF
Install the Docker engine, daemon, and service.
sudo yum install -y docker-engine-1.13.1 docker-engine-selinux-1.13.1 sudo systemctl start docker sudo systemctl enable docker
When the process completes, you should see:
Complete! Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
Test that Docker is properly installed:
sudo docker ps
For more generic Docker requirements, see System Requirements: Docker.