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