Skip to content

Commit 8b5f281

Browse files
The-Loekishin-
authored andcommitted
build_prune
Signed-off-by: Ronald van Zantvoort <[email protected]>
1 parent d2d9982 commit 8b5f281

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docker/api/build.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,22 @@ def _set_auth_headers(self, headers):
305305
else:
306306
log.debug('No auth config found')
307307

308+
@utils.minimum_version('1.31')
309+
def prune_build(self):
310+
"""
311+
Delete builder cache
312+
313+
Returns:
314+
(dict): A dict containing
315+
the amount of disk space reclaimed in bytes.
316+
317+
Raises:
318+
:py:class:`docker.errors.APIError`
319+
If the server returns an error.
320+
"""
321+
url = self._url("/build/prune")
322+
return self._result(self._post(url), True)
323+
308324

309325
def process_dockerfile(dockerfile, path):
310326
if not dockerfile:

0 commit comments

Comments
 (0)