mirror of https://github.com/docker/docker-py.git
feat: add pause option to commit api (#3159)
add commit pause option Signed-off-by: VincentLeeMax <lichlee@yeah.net> Co-authored-by: Milas Bowman <milas.bowman@docker.com>
This commit is contained in:
parent
0618951093
commit
4571f7f9b4
|
@ -112,7 +112,7 @@ class ContainerApiMixin:
|
|||
|
||||
@utils.check_resource('container')
|
||||
def commit(self, container, repository=None, tag=None, message=None,
|
||||
author=None, changes=None, conf=None):
|
||||
author=None, pause=True, changes=None, conf=None):
|
||||
"""
|
||||
Commit a container to an image. Similar to the ``docker commit``
|
||||
command.
|
||||
|
@ -123,6 +123,7 @@ class ContainerApiMixin:
|
|||
tag (str): The tag to push
|
||||
message (str): A commit message
|
||||
author (str): The name of the author
|
||||
pause (bool): Whether to pause the container before committing
|
||||
changes (str): Dockerfile instructions to apply while committing
|
||||
conf (dict): The configuration for the container. See the
|
||||
`Engine API documentation
|
||||
|
@ -139,6 +140,7 @@ class ContainerApiMixin:
|
|||
'tag': tag,
|
||||
'comment': message,
|
||||
'author': author,
|
||||
'pause': pause,
|
||||
'changes': changes
|
||||
}
|
||||
u = self._url("/commit")
|
||||
|
|
|
@ -121,6 +121,7 @@ class Container(Model):
|
|||
tag (str): The tag to push
|
||||
message (str): A commit message
|
||||
author (str): The name of the author
|
||||
pause (bool): Whether to pause the container before committing
|
||||
changes (str): Dockerfile instructions to apply while committing
|
||||
conf (dict): The configuration for the container. See the
|
||||
`Engine API documentation
|
||||
|
|
|
@ -102,6 +102,7 @@ class ImageTest(BaseAPIClientTest):
|
|||
'tag': None,
|
||||
'container': fake_api.FAKE_CONTAINER_ID,
|
||||
'author': None,
|
||||
'pause': True,
|
||||
'changes': None
|
||||
},
|
||||
timeout=DEFAULT_TIMEOUT_SECONDS
|
||||
|
|
Loading…
Reference in New Issue