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-lvm mode 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. As of CentOS 7.2, “only XFS is currently supported for use as a lower layer file system“.
The following instructions demonstrate how to use Docker with OverlayFS on CentOS 7.
- Verify that the kernel is at least 3.10:
- Enable OverlayFS:
sudo tee /etc/modules-load.d/overlay.conf <<-'EOF'
- Reboot to reload kernel modules:
- Verify that OverlayFS is enabled:
lsmod | grep overlay
- Configure yum to use the Docker yum repo:
sudo tee /etc/yum.repos.d/docker.repo <<-'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'
ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd://
- Install the Docker engine, daemon, and service.
Important: Docker version 1.12.x is not supported.
sudo yum install -y docker-engine-1.11.2
sudo systemctl start docker
sudo systemctl enable docker
When the process completes, you should see:
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.