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

Method commit

docker/models/containers.py:127–151  ·  view source on GitHub ↗

Commit a container to an image. Similar to the ``docker commit`` command. Args: repository (str): The repository to push the image to tag (str): The tag to push message (str): A commit message author (str): The name of the aut

(self, repository=None, tag=None, **kwargs)

Source from the content-addressed store, hash-verified

125 return self.client.api.attach_socket(self.id, **kwargs)
126
127 def commit(self, repository=None, tag=None, **kwargs):
128 """
129 Commit a container to an image. Similar to the ``docker commit``
130 command.
131
132 Args:
133 repository (str): The repository to push the image to
134 tag (str): The tag to push
135 message (str): A commit message
136 author (str): The name of the author
137 pause (bool): Whether to pause the container before committing
138 changes (str): Dockerfile instructions to apply while committing
139 conf (dict): The configuration for the container. See the
140 `Engine API documentation
141 <https://docs.docker.com/reference/api/docker_remote_api/>`_
142 for full details.
143
144 Raises:
145 :py:class:`docker.errors.APIError`
146 If the server returns an error.
147 """
148
149 resp = self.client.api.commit(self.id, repository=repository, tag=tag,
150 **kwargs)
151 return self.client.images.get(resp['Id'])
152
153 def diff(self):
154 """

Callers 6

test_commitMethod · 0.45
test_commitMethod · 0.45
test_removeMethod · 0.45
test_commitMethod · 0.45
test_commitMethod · 0.45

Calls 1

getMethod · 0.45

Tested by 6

test_commitMethod · 0.36
test_commitMethod · 0.36
test_removeMethod · 0.36
test_commitMethod · 0.36
test_commitMethod · 0.36