Skip to content

Commit

Permalink
feat(build): add support for 'cache_from' and 'cache_to' instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
NefixEstrada committed Aug 10, 2023
1 parent bce40c2 commit bd51e02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit bd51e02

Please sign in to comment.