Make docker sessions interactive so that the 'shell' command works.
authorCarl Hetherington <cth@carlh.net>
Tue, 17 Mar 2020 00:18:58 +0000 (01:18 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 17 Mar 2020 00:18:58 +0000 (01:18 +0100)
cdist

diff --git a/cdist b/cdist
index 0a13bff3de9983a8ea12fc027b34e43381e1027f..4c21cef55fc3847d33fc028fe2ac51835527db08 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -553,7 +553,7 @@ class DockerTarget(Target):
 
     def command(self, cmd):
         dir = os.path.join(self.directory, os.path.relpath(os.getcwd(), self.directory))
-        command('%s exec %s -t %s /bin/bash -c \'export %s; cd %s; %s\'' % (config.docker(), self._user_tag(), self.container, self.variables_string(), dir, cmd))
+        command('%s exec %s -i -t %s /bin/bash -c \'export %s; cd %s; %s\'' % (config.docker(), self._user_tag(), self.container, self.variables_string(), dir, cmd))
 
     def cleanup(self):
         super(DockerTarget, self).cleanup()