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')
|
@utils.check_resource('container')
|
||||||
def commit(self, container, repository=None, tag=None, message=None,
|
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``
|
Commit a container to an image. Similar to the ``docker commit``
|
||||||
command.
|
command.
|
||||||
|
@ -123,6 +123,7 @@ class ContainerApiMixin:
|
||||||
tag (str): The tag to push
|
tag (str): The tag to push
|
||||||
message (str): A commit message
|
message (str): A commit message
|
||||||
author (str): The name of the author
|
author (str): The name of the author
|
||||||
|
pause (bool): Whether to pause the container before committing
|
||||||
changes (str): Dockerfile instructions to apply while committing
|
changes (str): Dockerfile instructions to apply while committing
|
||||||
conf (dict): The configuration for the container. See the
|
conf (dict): The configuration for the container. See the
|
||||||
`Engine API documentation
|
`Engine API documentation
|
||||||
|
@ -139,6 +140,7 @@ class ContainerApiMixin:
|
||||||
'tag': tag,
|
'tag': tag,
|
||||||
'comment': message,
|
'comment': message,
|
||||||
'author': author,
|
'author': author,
|
||||||
|
'pause': pause,
|
||||||
'changes': changes
|
'changes': changes
|
||||||
}
|
}
|
||||||
u = self._url("/commit")
|
u = self._url("/commit")
|
||||||
|
|
|
@ -121,6 +121,7 @@ class Container(Model):
|
||||||
tag (str): The tag to push
|
tag (str): The tag to push
|
||||||
message (str): A commit message
|
message (str): A commit message
|
||||||
author (str): The name of the author
|
author (str): The name of the author
|
||||||
|
pause (bool): Whether to pause the container before committing
|
||||||
changes (str): Dockerfile instructions to apply while committing
|
changes (str): Dockerfile instructions to apply while committing
|
||||||
conf (dict): The configuration for the container. See the
|
conf (dict): The configuration for the container. See the
|
||||||
`Engine API documentation
|
`Engine API documentation
|
||||||
|
|
|
@ -102,6 +102,7 @@ class ImageTest(BaseAPIClientTest):
|
||||||
'tag': None,
|
'tag': None,
|
||||||
'container': fake_api.FAKE_CONTAINER_ID,
|
'container': fake_api.FAKE_CONTAINER_ID,
|
||||||
'author': None,
|
'author': None,
|
||||||
|
'pause': True,
|
||||||
'changes': None
|
'changes': None
|
||||||
},
|
},
|
||||||
timeout=DEFAULT_TIMEOUT_SECONDS
|
timeout=DEFAULT_TIMEOUT_SECONDS
|
||||||
|
|
Loading…
Reference in New Issue