Rules Related To 'docker'

Component overview

Relevant packages:

Relevant groups:

Changelog:

No changes recorded.

Relevant rules:

Rule details

Ensure SELinux support is enabled in Docker

docker_selinux_enabled

Description

To enable the SELinux for the Docker service, the Docker service must be configured to run the Docker daemon with --selinux-enabled option. In /etc/sysconfig/docker configuration file, add or correct the following line to enable SELinux support in the Docker daemon:

OPTIONS='--selinux-enabled'

Rationale

If SELinux is not explicitely enabled in the Docker daemon configuration, Docker does not use SELinux which means Docker runs unconfined, and SELinux will not provide security separation for Docker container processes. However enabling SELinux for the Docker service prevents an attacker or rogue container from attacking other container processes and content as well as prevents taking over the host operating system.

Use direct-lvm with the Device Mapper Storage Driver

docker_storage_configured

Description

To use Docker in production with the device mapper storage driver, the Docker daemon should be configured to use direct-lvm instead of loopback device as a storage. For setting up the LVM and configuring Docker, see the Docker Device Mapper Storage Documentation.

Rationale

For using Docker in production, the device mapper storage driver with loopback devices is discouraged. The suggested way of configuring device mapper storage driver is direct-lvm. Choosing the right storage driver and backing filesystem is crucial to stability and performance.

Install the docker Package

package_docker_installed

Description

The docker package provides necessary software to create containers, which are self-sufficient and self-contained applications using the resource isolation features of the kernel. The docker package can be installed with the following command:

$ sudo yum install docker

Rationale

To be able to run the docker service, the docker package has to be installed.

Enable the Docker service

service_docker_enabled

Description

The docker service is commonly needed to create containers. The docker service can be enabled with the following command:

$ sudo systemctl enable docker.service

Rationale

To be able to find any problems with misconfiguration of the docker daemon and running containers, the docker service has to be enabled.