diff --git a/xd/docker/client.py b/xd/docker/client.py
index 3d2fe2e..ec42404 100644
--- a/xd/docker/client.py
+++ b/xd/docker/client.py
@@ -484,3 +484,27 @@ class DockerClient(object):
                 return False
             raise e
         return True
+
+    def container_wait(self,
+                       container: Union[Container, ContainerName, str]) -> int:
+        """Block until container stops.
+
+        Block until container stops, then returns the exit code.
+
+        Arguments:
+          container: The container to remove (id or name).
+
+        Returns:
+          Container exit code.
+        """
+
+        # Handle convenience argument types
+        if isinstance(container, str):
+            id_or_name = container
+        elif isinstance(container, ContainerName):
+            id_or_name = container.name
+        else:
+            id_or_name = container.id or container.name
+
+        r = self._post('/containers/{}/wait'.format(id_or_name))
+        return r.json()['StatusCode']

client.container_wait()
Client API command to wait for a container to stop.
diff --git a/tests/unit/client_test.py b/tests/unit/client_test.py
index 5b2eccd..0f1f130 100644
--- a/tests/unit/client_test.py
+++ b/tests/unit/client_test.py
@@ -1245,3 +1245,41 @@ class container_start_tests(ContextClientTestCase):
         with pytest.raises(ClientError) as clienterror:
             self.client.container_start('foobar')
         assert clienterror.value.code == 404
+
+
+class container_wait_tests(ContextClientTestCase):
+
+    @mock.patch('requests.post')
+    def test_0(self, post_mock):
+        post_mock.return_value = requests_mock.Response(json.dumps(
+            {'StatusCode': 0}), 200)
+        assert self.client.container_wait("foobar") == 0
+
+    @mock.patch('requests.post')
+    def test_42(self, post_mock):
+        post_mock.return_value = requests_mock.Response(json.dumps(
+            {'StatusCode': 42}), 200)
+        assert self.client.container_wait("foobar") == 42
+
+    @mock.patch('requests.post')
+    def test_no_such_container(self, post_mock):
+        post_mock.return_value = requests_mock.Response(json.dumps(
+            {'StatusCode': 42}), 200)
+        post_mock.return_value = requests_mock.Response(
+            "No such container", 404)
+        with pytest.raises(ClientError) as clienterror:
+            self.client.container_wait('foobar')
+        assert clienterror.value.code == 404
+
+    @mock.patch('requests.post')
+    def test_containername(self, post_mock):
+        post_mock.return_value = requests_mock.Response(json.dumps(
+            {'StatusCode': 0}), 200)
+        assert self.client.container_wait(ContainerName("foobar")) == 0
+
+    @mock.patch('requests.post')
+    def test_container(self, post_mock):
+        post_mock.return_value = requests_mock.Response(json.dumps(
+            {'StatusCode': 0}), 200)
+        assert self.client.container_wait(Container(
+            self.client,name="foobar")) == 0

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov mock flake8
apt-get update apt-get install -y gcc
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
flake8==5.0.4
idna==3.10
importlib-metadata==4.2.0
iniconfig==1.1.1
mccabe==0.7.0
mock==5.2.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
requests==2.27.1
requests-unixsocket==0.3.0
tomli==1.2.3
typing==3.7.4.3
typing_extensions==4.1.1
urllib3==1.26.20
-e git+https://github.com/XD-embedded/xd-docker.git@00db236f2385d476cd3f32e3fd4bf68fd1dd8a35#egg=XD_Docker
zipp==3.6.0

name: xd-docker
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - flake8==5.0.4
      - idna==3.10
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - mccabe==0.7.0
      - mock==5.2.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - requests==2.27.1
      - requests-unixsocket==0.3.0
      - tomli==1.2.3
      - typing==3.7.4.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/xd-docker

tests/unit/client_test.py::container_wait_tests::test_0 tests/unit/client_test.py::container_wait_tests::test_42 tests/unit/client_test.py::container_wait_tests::test_container tests/unit/client_test.py::container_wait_tests::test_containername tests/unit/client_test.py::container_wait_tests::test_no_such_container
tests/unit/client_test.py::init_tests::test_init_foobar tests/unit/client_test.py::init_tests::test_init_http tests/unit/client_test.py::init_tests::test_init_http_unix tests/unit/client_test.py::init_tests::test_init_noargs tests/unit/client_test.py::init_tests::test_init_tcp tests/unit/client_test.py::init_tests::test_init_unix tests/unit/client_test.py::version_tests::test_version tests/unit/client_test.py::version_tests::test_version_httperror_404 tests/unit/client_test.py::version_tests::test_version_httperror_500 tests/unit/client_test.py::version_tests::test_version_httperror_unknown tests/unit/client_test.py::ping_tests::test_ping tests/unit/client_test.py::ping_tests::test_ping_server_error tests/unit/client_test.py::containers_tests::test_containers_1 tests/unit/client_test.py::containers_tests::test_containers_3 tests/unit/client_test.py::containers_tests::test_containers_4 tests/unit/client_test.py::containers_tests::test_containers_only_running_false tests/unit/client_test.py::images_tests::test_images tests/unit/client_test.py::image_inspect_tests::test_image_inspect tests/unit/client_test.py::image_inspect_tests::test_image_inspect_raw tests/unit/client_test.py::image_build_tests::test_image_build tests/unit/client_test.py::image_build_tests::test_image_build_context_as_file tests/unit/client_test.py::image_build_tests::test_image_build_context_does_not_exist tests/unit/client_test.py::image_build_tests::test_image_build_invalid_pull tests/unit/client_test.py::image_build_tests::test_image_build_invalid_rm tests/unit/client_test.py::image_build_tests::test_image_build_invalid_tag_1 tests/unit/client_test.py::image_build_tests::test_image_build_invalid_tag_2 tests/unit/client_test.py::image_build_tests::test_image_build_nonstandard_dockerfile tests/unit/client_test.py::image_build_tests::test_image_build_run_error tests/unit/client_test.py::image_build_tests::test_image_build_server_error tests/unit/client_test.py::image_build_tests::test_image_build_with_args tests/unit/client_test.py::image_build_tests::test_image_build_with_forcerm tests/unit/client_test.py::image_build_tests::test_image_build_with_name tests/unit/client_test.py::image_build_tests::test_image_build_with_nocache tests/unit/client_test.py::image_build_tests::test_image_build_with_norm tests/unit/client_test.py::image_build_tests::test_image_build_with_only_error_output tests/unit/client_test.py::image_build_tests::test_image_build_with_pull tests/unit/client_test.py::image_build_tests::test_image_build_with_registry_config tests/unit/client_test.py::image_pull_tests::test_image_pull_1_ok tests/unit/client_test.py::image_pull_tests::test_image_pull_2_not_found tests/unit/client_test.py::image_pull_tests::test_image_pull_3_authconfig tests/unit/client_test.py::image_pull_tests::test_image_pull_4_invalid_authconfig tests/unit/client_test.py::image_remove_tests::test_image_remove_1 tests/unit/client_test.py::image_remove_tests::test_image_remove_2_not_found tests/unit/client_test.py::image_tag_tests::test_image_tag_1_repo tests/unit/client_test.py::image_tag_tests::test_image_tag_2_repo_and_tag tests/unit/client_test.py::image_tag_tests::test_image_tag_3_force tests/unit/client_test.py::image_tag_tests::test_image_tag_4_fail tests/unit/client_test.py::container_create_tests::test_container_create_1_anon tests/unit/client_test.py::container_create_tests::test_container_create_2_named tests/unit/client_test.py::container_create_tests::test_container_create_3_named_str tests/unit/client_test.py::container_create_tests::test_container_create_nopull_needed tests/unit/client_test.py::container_create_tests::test_container_create_nopull_not_needed tests/unit/client_test.py::container_create_tests::test_container_create_pull_needed tests/unit/client_test.py::container_create_tests::test_container_create_pull_not_needed tests/unit/client_test.py::container_create_tests::test_container_create_with_command tests/unit/client_test.py::container_create_tests::test_container_create_with_env tests/unit/client_test.py::container_create_tests::test_container_create_with_exposed_ports tests/unit/client_test.py::container_create_tests::test_container_create_with_memory tests/unit/client_test.py::container_create_tests::test_container_create_with_memory_and_swap tests/unit/client_test.py::container_create_tests::test_container_create_with_network_false tests/unit/client_test.py::container_create_tests::test_container_create_with_oom_kill_false tests/unit/client_test.py::container_create_tests::test_container_create_with_swap_but_not_memory tests/unit/client_test.py::container_remove_tests::test_container_with_id tests/unit/client_test.py::container_remove_tests::test_container_with_id_and_name tests/unit/client_test.py::container_remove_tests::test_container_with_name tests/unit/client_test.py::container_remove_tests::test_containername tests/unit/client_test.py::container_remove_tests::test_force_false tests/unit/client_test.py::container_remove_tests::test_force_true tests/unit/client_test.py::container_remove_tests::test_no_such_container tests/unit/client_test.py::container_remove_tests::test_ok tests/unit/client_test.py::container_remove_tests::test_volumes_false tests/unit/client_test.py::container_remove_tests::test_volumes_true tests/unit/client_test.py::container_start_tests::test_already_running tests/unit/client_test.py::container_start_tests::test_container_with_id tests/unit/client_test.py::container_start_tests::test_container_with_id_and_name tests/unit/client_test.py::container_start_tests::test_container_with_name tests/unit/client_test.py::container_start_tests::test_containername tests/unit/client_test.py::container_start_tests::test_no_such_container tests/unit/client_test.py::container_start_tests::test_str
xd/docker/client.py
xd/docker/client.py