From 414e5fb4ca7f14fae5ff57c4fb1fd64b77e9b733 Mon Sep 17 00:00:00 2001
From: Jamie Anderson <jamieand@amazon.com>
Date: Fri, 12 Mar 2021 17:10:08 +0000
Subject: [PATCH] Support /etc/docker-runtimes.d

Reworked for docker 20.10.4
Original patch message:
  From 77efbceb6f074900c72855af903b63685803bc59 Mon Sep 17 00:00:00 2001
  From: Jacob Vallejo <jakeev@amazon.com>
  Date: Mon, 23 Sep 2019 15:58:38 -0700
  Subject: [PATCH] Support /etc/docker-runtimes.d

  Use additional configured runtimes by evaluating their configs and
  subsequently providing any necessary configuration flags to the docker
  daemon at startup.

Signed-off-by: Jamie Anderson <jamieand@amazon.com>
---
 contrib/init/systemd/docker.service | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/init/systemd/docker.service b/contrib/init/systemd/docker.service
index d76aee3..7e87245 100644
--- a/contrib/init/systemd/docker.service
+++ b/contrib/init/systemd/docker.service
@@ -9,10 +9,13 @@ Requires=docker.socket
 Type=notify
 EnvironmentFile=-/etc/sysconfig/docker
 EnvironmentFile=-/etc/sysconfig/docker-storage
+EnvironmentFile=-/run/docker/runtimes.env
+ExecStartPre=/bin/mkdir -p /run/docker
+ExecStartPre=/usr/libexec/docker/docker-setup-runtimes.sh
 # the default is not to use systemd for cgroups because the delegate issues still
 # exists and systemd currently does not support the cgroup feature set required
 # for containers run by docker
-ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $OPTIONS $DOCKER_STORAGE_OPTIONS
+ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_ADD_RUNTIMES
 ExecReload=/bin/kill -s HUP $MAINPID
 LimitNOFILE=1048576
 # Having non-zero Limit*s causes performance problems due to accounting overhead
-- 
2.31.0.rc2

