Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): add support for 'cache_from' and 'cache_to' instructions #744

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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