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

Method get

docker/models/containers.py:938–955  ·  view source on GitHub ↗

Get a container by name or ID. Args: container_id (str): Container name or ID. Returns: A :py:class:`Container` object. Raises: :py:class:`docker.errors.NotFound` If the container does not exist. :py:

(self, container_id)

Source from the content-addressed store, hash-verified

936 return self.get(resp['Id'])
937
938 def get(self, container_id):
939 """
940 Get a container by name or ID.
941
942 Args:
943 container_id (str): Container name or ID.
944
945 Returns:
946 A :py:class:`Container` object.
947
948 Raises:
949 :py:class:`docker.errors.NotFound`
950 If the container does not exist.
951 :py:class:`docker.errors.APIError`
952 If the server returns an error.
953 """
954 resp = self.client.api.inspect_container(container_id)
955 return self.prepare_model(resp)
956
957 def list(self, all=False, before=None, filters=None, limit=-1, since=None,
958 sparse=False, ignore_removed=False):

Callers 10

createMethod · 0.95
listMethod · 0.95
nameMethod · 0.45
imageMethod · 0.45
labelsMethod · 0.45
healthMethod · 0.45
portsMethod · 0.45
commitMethod · 0.45
runMethod · 0.45
_create_container_argsFunction · 0.45

Calls 2

inspect_containerMethod · 0.80
prepare_modelMethod · 0.80

Tested by

no test coverage detected