mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-21 23:43:24 +01:00
Use defined environment variables in the image build process
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>
This commit is contained in:
parent
bf07e91163
commit
901adf47d0
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user