Skip to content

Instantly share code, notes, and snippets.

@philk
Created September 12, 2013 19:55
Show Gist options
  • Save philk/6542959 to your computer and use it in GitHub Desktop.
Save philk/6542959 to your computer and use it in GitHub Desktop.
def run_container(**kwargs):
if kwargs['once']:
ctrs = s.containers(
image=kwargs['image'],
command=kwargs['command']
)
if len(ctrs) == 1:
return s.inspect(ctrs[0])[0]
else:
ctr = s.run(**kwargs)
return s.inspect(ctr[0])[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment