Install the docker Package
An XCCDF Rule
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.
- ID
- xccdf_org.ssgproject.content_rule_package_docker_installed
- Severity
- Medium
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
if ! rpm -q --quiet "docker" ; then
yum install -y "docker"
fi
Remediation - Anaconda Pre-Install Instructions
package --add=docker
Remediation - OS Build Blueprint
[[packages]]
name = "docker"
version = "*"
Remediation - Ansible
- name: Ensure docker is installed
package:
name: docker
state: present
when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
Remediation - Puppet
include install_docker
class install_docker {
package { 'docker':
ensure => 'installed',
}