implement services.*.build.tags

https://github.com/compose-spec/compose-spec/blob/master/build.md#tags
This commit is contained in:
Wilke Schwiedop 2022-07-27 20:05:38 +02:00 committed by Muayyad Alsadi
parent 8d1a4d7274
commit 5b9cfe5d17

View File

@ -1904,7 +1904,9 @@ def build_one(compose, args, cnt):
break
if not os.path.exists(dockerfile):
raise OSError("Dockerfile not found in " + ctx)
build_args = ["-t", cnt["image"], "-f", dockerfile]
build_args = ["-f", dockerfile, "-t", cnt["image"]]
for tag in build_desc.get("tags", []):
build_args.extend(["-t", tag])
if "target" in build_desc:
build_args.extend(["--target", build_desc["target"]])
container_to_ulimit_args(cnt, build_args)