Skip to content

Commit c7aa9c5

Browse files
committed
feat(build): add support for 'cache_from' and 'cache_to' instructions
Signed-off-by: Néfix Estrada <[email protected]>
1 parent bce40c2 commit c7aa9c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

podman_compose.py

+8
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,14 @@ def build_one(compose, args, cnt):
21282128
build_args.extend(["-t", tag])
21292129
if "target" in build_desc:
21302130
build_args.extend(["--target", build_desc["target"]])
2131+
cache_from = build_desc.get("cache_from", [])
2132+
cache_to = build_desc.get("cache_to", [])
2133+
if cache_from or cache_to:
2134+
build_args.extend(["--layers"])
2135+
for cache in cache_from:
2136+
build_args.extend(["--cache-from", cache])
2137+
for cache in cache_to:
2138+
build_args.extend(["--cache-to", cache])
21312139
container_to_ulimit_args(cnt, build_args)
21322140
if getattr(args, "no_cache", None):
21332141
build_args.append("--no-cache")

0 commit comments

Comments
 (0)