podman-compose
podman-compose copied to clipboard
podman-compose build exits 0 when build fails
Hello!
I have been using podman-compose for a bit and love it but I noticed that when I run podman-compose build
it always exits 0 regardless of if the build failed or not.
It does print out the exit code of the underlying podman command but I don't want to parse the output for that. Would it be possible to have the build command exit with the underlying exit code if it runs into a failure?
I have my local version of podman-compose patched with:
obj = types.SimpleNamespace()
compose.podman.run([], "build", build_args, sleep=0, obj=obj)
if obj.exit_code != 0:
sys.exit(obj.exit_code)
on https://github.com/containers/podman-compose/blob/devel/podman_compose.py#L1898. I'm not sure if there's a better solution.
Hi, we're running into the same issue, is there an expected fix for this?
This is not an enhacement, this is a bug
Facing this behavior as well, pretty inconsistent when podman-compose is being used in CI workflows.
@muayyad-alsadi Are you considering PR #521 or is that now how you'd perfer podman-compose to work?
What is worse, podman-compose up --build
continues even though the build fails for one image, and it starts the old version of the image and to figure that out I'd just have to keep eye on whatever output podman-compose
spits out
This affects our efforts to have the same recipes for running services in both Docker and Podman as we migrate. It also makes debugging significantly more difficult, because if the image fails to build, then typically Podman will also fail for a different reason, such as the container not being present.