Parameters
The DOCKER module provides 8 configuration parameters.
Parameter Overview
Use the DOCKER parameter group to deploy and configure the Docker container engine. It controls the enable switch, data directory, storage driver, registry mirrors, and monitoring.
| Parameter | Type | Level | Description |
|---|---|---|---|
docker_enabled | bool | G/C/I | Enable Docker on current node? disabled by default |
docker_data | path | G/C/I | Docker data directory, /data/docker by default |
docker_storage_driver | enum | G/C/I | Docker storage driver, overlay2 by default |
docker_cgroups_driver | enum | G/C/I | Docker cgroup driver: cgroupfs or systemd |
docker_registry_mirrors | string[] | G/C/I | Docker registry mirror list |
docker_exporter_port | port | G | Docker metrics exporter port, 9323 by default |
docker_image | string[] | G/C/I | Docker images to pull, empty list by default |
docker_image_cache | path | G/C/I | Docker image cache tarball path, /tmp/docker/*.tgz |
You can use the docker.yml playbook to install and enable Docker on nodes.
Default parameters are defined in roles/docker/defaults/main.yml
docker_enabled
Parameter: docker_enabled, Type: bool, Level: G/C/I
Specifies whether to enable Docker on the current node. The default is false, which disables Docker.
docker_data
Parameter: docker_data, Type: path, Level: G/C/I
Docker data directory, default is /data/docker.
This directory stores Docker images, containers, volumes, and other data. If you have a dedicated data disk, we recommend its mount point for this directory.
docker_storage_driver
Parameter: docker_storage_driver, Type: enum, Level: G/C/I
Docker storage driver, default is overlay2.
See official documentation: https://docs.docker.com/engine/storage/drivers/select-storage-driver/
Available storage drivers include:
overlay2: Recommended default driver, suitable for most scenariosfuse-overlayfs: For rootless container scenariosbtrfs: When using Btrfs filesystemzfs: When using ZFS filesystemvfs: For testing purposes, not recommended for production
docker_cgroups_driver
Parameter: docker_cgroups_driver, Type: enum, Level: G/C/I
Docker cgroup filesystem driver. Set it to cgroupfs or systemd. The default is systemd.
docker_registry_mirrors
Parameter: docker_registry_mirrors, Type: string[], Level: G/C/I
Docker registry mirror list, default: [] empty array.
You can use Docker mirror sites to accelerate image pulls. Here are some examples:
You can also consider using a Cloudflare Worker to set up a Docker Proxy for faster access.
If pull speeds are still too slow, consider using alternative registries: docker login quay.io
docker_exporter_port
Parameter: docker_exporter_port, Type: port, Level: G
Docker metrics exporter port, default is 9323.
The Docker daemon exposes Prometheus-format monitoring metrics on this port for collection by monitoring infrastructure.
docker_image
Parameter: docker_image, Type: string[], Level: G/C/I
List of Docker images to pull, default is empty list [].
During installation, Docker automatically pulls the images specified here.
docker_image_cache
Parameter: docker_image_cache, Type: path, Level: G/C/I
Local Docker image cache tarball glob pattern, default is /tmp/docker/*.tgz.
Use docker save | gzip to package images. Set this parameter to import those images automatically during Docker installation.
Docker imports each .tgz tarball that matches this pattern with the following command:
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)