Docker: Set Cgroup driver by default to systemd (#6563)

* Set Docker Cgroup driver to systemd

* Add docker_cgroup_driver in Docker defaults
pull/6605/head
Barry Melbourne 2020-08-31 12:56:20 +01:00 committed by GitHub
parent 5a8b68a429
commit 03c9c091f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -10,6 +10,10 @@ docker_container_storage_setup: false
## Otherwise docker-storage-setup will be executed incorrectly.
# docker_container_storage_setup_devs: /dev/vdb
## Uncomment this if you want to change the Docker Cgroup driver (native.cgroupdriver)
## Valid options are systemd or cgroupfs, default is systemd
# docker_cgroup_driver: systemd
## Uncomment this if you have more than 3 nameservers, then we'll only use the first 3.
docker_dns_servers_strict: false

View File

@ -18,6 +18,8 @@ dockerproject_repo_key_info:
dockerproject_repo_info:
repos:
docker_cgroup_driver: systemd
docker_dns_servers_strict: true
docker_container_storage_setup: false

View File

@ -1,12 +1,12 @@
[Service]
Environment="DOCKER_OPTS={{ docker_options|default('') }} --iptables={{ docker_iptables_enabled | default('false') }} \
--exec-opt native.cgroupdriver={{ docker_cgroup_driver }} \
{% for i in docker_insecure_registries %}--insecure-registry={{ i }} {% endfor %} \
{% for i in docker_registry_mirrors %}--registry-mirror={{ i }} {% endfor %} \
{% if docker_version != "latest" and docker_version is version('17.05', '<') %}--graph={% else %}--data-root={% endif %}{{ docker_daemon_graph }} \
{% if ansible_os_family not in ["openSUSE Leap", "openSUSE Tumbleweed", "Suse"] %}{{ docker_log_opts }}{% endif %} \
{% if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
--default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc \
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current --signature-verification=false \
{% endif %}"