From 82ca3d9a6a3b6958b561aeafd24a1405e60a8ed4 Mon Sep 17 00:00:00 2001 From: VincentLeeMax Date: Wed, 12 Jul 2023 13:25:31 +0800 Subject: [PATCH] add commit pause option Signed-off-by: VincentLeeMax --- docker/api/container.py | 4 +++- docker/models/containers.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/api/container.py b/docker/api/container.py index 40607e79a..b8d5957b6 100644 --- a/docker/api/container.py +++ b/docker/api/container.py @@ -112,7 +112,7 @@ def attach_socket(self, container, params=None, ws=False): @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 @@ def commit(self, container, repository=None, tag=None, message=None, 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 @@ def commit(self, container, repository=None, tag=None, message=None, 'tag': tag, 'comment': message, 'author': author, + 'pause': pause, 'changes': changes } u = self._url("/commit") diff --git a/docker/models/containers.py b/docker/models/containers.py index 2eeefda1e..64838397a 100644 --- a/docker/models/containers.py +++ b/docker/models/containers.py @@ -121,6 +121,7 @@ def commit(self, repository=None, tag=None, **kwargs): 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