mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-27 02:49:05 +02:00
FIXES #167: support ContainerFile
This commit is contained in:
parent
c9486c9f3b
commit
c753b8e2cf
@ -1328,9 +1328,17 @@ def build_one(compose, args, cnt):
|
|||||||
if not hasattr(build_desc, 'items'):
|
if not hasattr(build_desc, 'items'):
|
||||||
build_desc = dict(context=build_desc)
|
build_desc = dict(context=build_desc)
|
||||||
ctx = build_desc.get('context', '.')
|
ctx = build_desc.get('context', '.')
|
||||||
dockerfile = os.path.join(ctx, build_desc.get("dockerfile", "Dockerfile"))
|
dockerfile = build_desc.get("dockerfile", None)
|
||||||
if not os.path.exists(dockerfile):
|
if dockerfile:
|
||||||
dockerfile = os.path.join(ctx, build_desc.get("dockerfile", "dockerfile"))
|
dockerfile = os.path.join(ctx, dockerfile)
|
||||||
|
else:
|
||||||
|
dockerfile_alts = [
|
||||||
|
'Containerfile', 'ContainerFile', 'containerfile',
|
||||||
|
'Dockerfile', 'DockerFile','dockerfile',
|
||||||
|
]
|
||||||
|
for dockerfile in dockerfile_alts:
|
||||||
|
dockerfile = os.path.join(ctx, dockerfile)
|
||||||
|
if os.path.exists(dockerfile): break
|
||||||
if not os.path.exists(dockerfile):
|
if not os.path.exists(dockerfile):
|
||||||
raise OSError("Dockerfile not found in "+ctx)
|
raise OSError("Dockerfile not found in "+ctx)
|
||||||
build_args = ["-t", cnt["image"], "-f", dockerfile]
|
build_args = ["-t", cnt["image"], "-f", dockerfile]
|
||||||
|
Loading…
Reference in New Issue
Block a user