diff --git a/paunch/builder/base.py b/paunch/builder/base.py index cbf035e..b705c4f 100644 --- a/paunch/builder/base.py +++ b/paunch/builder/base.py @@ -266,6 +266,7 @@ class BaseBuilder(object): cmd.append('--privileged=%s' % str(cconfig['privileged']).lower()) if 'user' in cconfig: cmd.append('--user=%s' % cconfig['user']) + self.list_or_dict_arg(cconfig, cmd, 'environment', '--env') command = self.command_argument(cconfig.get('command')) # for exec, the first argument is the container name, # make sure the correct one is used diff --git a/paunch/tests/test_builder_base.py b/paunch/tests/test_builder_base.py index 6b9e97e..897f565 100644 --- a/paunch/tests/test_builder_base.py +++ b/paunch/tests/test_builder_base.py @@ -583,6 +583,7 @@ three-12345678 three''', '', 0), 'one': { 'command': 'ls -l /foo', 'privileged': True, + 'environment': {'FOO': 'BAR'}, 'user': 'bar' } } @@ -594,6 +595,7 @@ three-12345678 three''', '', 0), self.assertEqual( ['docker', 'exec', '--privileged=true', '--user=bar', + '--env=FOO=BAR', 'one-12345678', '-l', '/foo'], cmd )