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

Method wait

docker/models/containers.py:507–528  ·  view source on GitHub ↗

Block until the container stops, then return its exit code. Similar to the ``docker wait`` command. Args: timeout (int): Request timeout condition (str): Wait until a container state reaches the given condition, either ``not-running``

(self, **kwargs)

Source from the content-addressed store, hash-verified

505 return self.client.api.update_container(self.id, **kwargs)
506
507 def wait(self, **kwargs):
508 """
509 Block until the container stops, then return its exit code. Similar to
510 the ``docker wait`` command.
511
512 Args:
513 timeout (int): Request timeout
514 condition (str): Wait until a container state reaches the given
515 condition, either ``not-running`` (default), ``next-exit``,
516 or ``removed``
517
518 Returns:
519 (dict): The API's response as a Python dictionary, including
520 the container's exit code under the ``StatusCode`` attribute.
521
522 Raises:
523 :py:class:`requests.exceptions.ReadTimeout`
524 If the timeout is exceeded.
525 :py:class:`docker.errors.APIError`
526 If the server returns an error.
527 """
528 return self.client.api.wait(self.id, **kwargs)
529
530
531class ContainerCollection(Collection):

Callers 15

test_run_with_volumeMethod · 0.45
test_commitMethod · 0.45
test_diffMethod · 0.45
test_logsMethod · 0.45
test_removeMethod · 0.45
test_waitMethod · 0.45
run_containerMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_run_with_volumeMethod · 0.36
test_commitMethod · 0.36
test_diffMethod · 0.36
test_logsMethod · 0.36
test_removeMethod · 0.36
test_waitMethod · 0.36
test_group_id_intsMethod · 0.36