Browse Source

Add configurable docker cgroupdriver

Some distros docker packaging use systemd instead of cgroupfs as the
cgroupdriver. This patch allows users to choose their cgroupdriver.

Change-Id: I95b51591d0aa5495ec583c3c87c77942109b4067
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
Antoni Segura Puimedon 1 year ago
parent
commit
f3c2d301fb
No account linked to committer's email address
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      devstack/lib/docker

+ 10
- 0
devstack/lib/docker View File

@@ -25,6 +25,7 @@ DOCKER_ENGINE_SOCKET_FILE=${DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock}
25 25
 DOCKER_ENGINE_PORT=${DOCKER_ENGINE_PORT:-2375}
26 26
 DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-}
27 27
 DOCKER_GROUP=${DOCKER_GROUP:-$STACK_USER}
28
+DOCKER_CGROUP_DRIVER=${DOCKER_CGROUP_DRIVER:-}
28 29
 
29 30
 
30 31
 # Functions
@@ -95,6 +96,15 @@ function configure_docker {
95 96
     $cluster_store_opts
96 97
     "debug": ${debug},
97 98
     "group": "$DOCKER_GROUP",
99
+EOF
100
+    if [[ -n "$DOCKER_CGROUP_DRIVER" ]]; then
101
+
102
+    cat <<EOF | sudo tee -a $docker_config_file >/dev/null
103
+    "exec-opts": ["native.cgroupdriver=${DOCKER_CGROUP_DRIVER}"],
104
+EOF
105
+    fi
106
+
107
+    cat <<EOF | sudo tee -a $docker_config_file >/dev/null
98 108
     "hosts": [
99 109
         "unix://$DOCKER_ENGINE_SOCKET_FILE",
100 110
         "tcp://0.0.0.0:$DOCKER_ENGINE_PORT"

Loading…
Cancel
Save