Skip to content

Commit f5fcf99

Browse files
committed
Merge pull request #379 from opdemand/fix-deis-run
Fix `deis run` environment and remove ephemeral container
2 parents a6139b4 + 4790335 commit f5fcf99

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

api/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,12 @@ def run(self, command):
541541
# prepare ssh command
542542
version = release.version
543543
docker_args = ' '.join(
544-
['-a', 'stdout', '-a', 'stderr',
544+
['-a', 'stdout', '-a', 'stderr', '-rm',
545545
'-v', '/opt/deis/runtime/slugs/{app_id}-v{version}:/app'.format(**locals()),
546546
'deis/slugrunner'])
547-
command = "sudo docker run {docker_args} {command}".format(**locals())
547+
env_args = ' '.join(["-e '{k}={v}'".format(**locals())
548+
for k, v in release.config.values.items()])
549+
command = "sudo docker run {env_args} {docker_args} {command}".format(**locals())
548550
return node.run(command)
549551

550552

0 commit comments

Comments
 (0)