Created
September 12, 2013 19:55
-
-
Save philk/6542959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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