Documentation
PLEASE NOTE: This document applies to latest version and not to the latest stable release v2.21
Documentation for other releases can be found by using the version selector in the top right of any doc page.docker_config
Manage Docker daemon configuration (daemon.json).
Attributes
check_mode:
support: full
Parameters
| Parameter | Required | Type | Values | Description |
|---|---|---|---|---|
| path | string | Path to the Docker daemon.json file. [default: /etc/docker/daemon.json] |
||
| storage_driver | string | Docker storage driver (e.g., overlay2, devicemapper). | ||
| registry_mirrors | array | List of Docker registry mirrors. | ||
| log_driver | string | Default logging driver for containers. | ||
| log_opts | object | Logging driver options as key-value pairs. | ||
| live_restore | boolean | Enable live restore of containers when daemon shuts down. | ||
| max_concurrent_downloads | integer | Maximum number of concurrent downloads per pull. | ||
| max_concurrent_uploads | integer | Maximum number of concurrent uploads per push. | ||
| default_ulimits | object | Default ulimits for containers. | ||
| userland_proxy | boolean | Enable userland proxy for loopback addresses. | ||
| disable_legacy_registry | boolean | Disable legacy registry (v1) support. | ||
| debug | boolean | Enable debug mode. | ||
| hosts | array | Docker hosts to listen on (e.g., [“tcp://0.0.0.0:2375”, “unix:///var/run/docker.sock”]). | ||
| tls | boolean | TLS configuration. | ||
| tlscert | string | Path to TLS certificate. | ||
| tlskey | string | Path to TLS key. | ||
| tlscacert | string | Path to TLS CA certificate. | ||
| key | string | Arbitrary configuration key using dot notation. | ||
| value | Value to set for arbitrary key. | |||
| state | string | present absent |
Whether configuration should exist or not. [default: "present"] |
|
| backup | boolean | Create a backup before modifying. [default: false] |
||
| reload | boolean | Restart Docker daemon after configuration change. [default: false] |
Examples
- name: Set Docker storage driver
docker_config:
storage_driver: overlay2
- name: Configure Docker registry mirrors
docker_config:
registry_mirrors:
- "https://mirror1.example.com"
- "https://mirror2.example.com"
- name: Set Docker log configuration
docker_config:
log_driver: json-file
log_opts:
max-size: 10m
max-file: 3
- name: Configure Docker live restore
docker_config:
live_restore: true
- name: Set multiple Docker options
docker_config:
storage_driver: overlay2
default_ulimits:
nofile:
name: nofile
hard: 65536
soft: 65536
userland_proxy: false
- name: Remove a configuration option
docker_config:
userland_proxy: null
state: absent
- name: Configure Docker with custom path
docker_config:
path: /etc/docker/daemon.json
storage_driver: overlay2
backup: true