Remove a container. Similar to the ``docker rm`` command. Args: container (str): The container to remove v (bool): Remove the volumes associated with the container link (bool): Remove the specified link and not the underlying cont
(self, container, v=False, link=False, force=False)
| 1015 | |
| 1016 | @utils.check_resource('container') |
| 1017 | def remove_container(self, container, v=False, link=False, force=False): |
| 1018 | """ |
| 1019 | Remove a container. Similar to the ``docker rm`` command. |
| 1020 | |
| 1021 | Args: |
| 1022 | container (str): The container to remove |
| 1023 | v (bool): Remove the volumes associated with the container |
| 1024 | link (bool): Remove the specified link and not the underlying |
| 1025 | container |
| 1026 | force (bool): Force the removal of a running container (uses |
| 1027 | ``SIGKILL``) |
| 1028 | |
| 1029 | Raises: |
| 1030 | :py:class:`docker.errors.APIError` |
| 1031 | If the server returns an error. |
| 1032 | """ |
| 1033 | params = {'v': v, 'link': link, 'force': force} |
| 1034 | res = self._delete( |
| 1035 | self._url("/containers/{0}", container), params=params |
| 1036 | ) |
| 1037 | self._raise_for_status(res) |
| 1038 | |
| 1039 | @utils.check_resource('container') |
| 1040 | def rename(self, container, name): |