From bd51e023c1ad4ab51fff80f9a0c7aea5d04e64f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9fix=20Estrada?= Date: Thu, 10 Aug 2023 18:22:27 +0200 Subject: [PATCH] feat(build): add support for 'cache_from' and 'cache_to' instructions --- podman_compose.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/podman_compose.py b/podman_compose.py index 2001145..86e39a7 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -2128,6 +2128,14 @@ def build_one(compose, args, cnt): build_args.extend(["-t", tag]) if "target" in build_desc: build_args.extend(["--target", build_desc["target"]]) + cache_from = build_desc.get("cache_from", []) + cache_to = build_desc.get("cache_to", []) + if cache_from or cache_to: + build_args.extend(["--layers"]) + for cache in cache_from: + build_args.extend(["--cache-from", cache]) + for cache in cache_to: + build_args.extend(["--cache-to", cache]) container_to_ulimit_args(cnt, build_args) if getattr(args, "no_cache", None): build_args.append("--no-cache")