MCPcopy Index your code
hub / github.com/docker/docker-py / remove_container

Method remove_container

docker/api/container.py:1017–1037  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 11

tearDownMethod · 0.80
test_removeMethod · 0.80
test_remove_linkMethod · 0.80
test_remove_linkMethod · 0.80
test_remove_containerMethod · 0.80
tearDownMethod · 0.80
removeMethod · 0.80

Calls 3

_deleteMethod · 0.80
_urlMethod · 0.80
_raise_for_statusMethod · 0.80