Skip to content

Commit

Permalink
Use defined environment variables in the image build process
Browse files Browse the repository at this point in the history
Build images with service environment variables defined so that they can be
used in the build process

Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
  • Loading branch information
hedayat authored and muayyad-alsadi committed Jul 18, 2023
1 parent bf07e91 commit 901adf4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,10 @@ def build_one(compose, args, cnt):
build_args.append("--pull-always")
elif getattr(args, "pull", None):
build_args.append("--pull")
env = dict(cnt.get("environment", {}))
for name, value in env.items():
build_args += ["--env", f"{name}" if value is None else f"{name}={value}"]

args_list = norm_as_list(build_desc.get("args", {}))
for build_arg in args_list + args.build_arg:
build_args.extend(
Expand Down

0 comments on commit 901adf4

Please sign in to comment.