#NEWLINE# def create_docker_container( url , image_tag ) : #NEWLINE# #INDENT# image = p #NEWLINE# command = [ "docker run -d -t -i -p 80 -p 22 --name '{url}' {image}" . format ( url = url , image = image ) ] #NEWLINE# p = subprocess . Popen ( command , stdout = subprocess . PIPE , stderr = subprocess . PIPE , shell = True ) #NEWLINE# ( output , err ) = p . communicate ( ) #NEWLINE# container_id = output . decode ( 'utf-8' ) #NEWLINE# p . stderr . close ( ) #NEWLINE# p . stdout . close ( ) #NEWLINE# return container_id