MCPcopy
hub / github.com/docker/docker-py / run_container

Method run_container

tests/integration/base.py:98–109  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

96 )
97
98 def run_container(self, *args, **kwargs):
99 container = self.client.create_container(*args, **kwargs)
100 self.tmp_containers.append(container)
101 self.client.start(container)
102 exitcode = self.client.wait(container)['StatusCode']
103
104 if exitcode != 0:
105 output = self.client.logs(container)
106 raise Exception(
107 f"Container exited with code {exitcode}:\n{output}")
108
109 return container
110
111 def create_and_start(self, image=TEST_IMG, command='top', **kwargs):
112 container = self.client.create_container(

Callers 5

run_with_volumeMethod · 0.45

Calls 4

create_containerMethod · 0.80
startMethod · 0.45
waitMethod · 0.45
logsMethod · 0.45

Tested by 5

run_with_volumeMethod · 0.36