containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
4.85k stars 463 forks source link

Add ability to input docker-compose.yaml via stdin #966

Closed ArthoPacini closed 2 weeks ago

ArthoPacini commented 2 weeks ago

Simple modification to add the ability to input docker-compose.yaml via stdin, that was lacking...

ArthoPacini commented 2 weeks ago

That would solve https://github.com/containers/podman-compose/issues/269#issue-793229346

p12tic commented 2 weeks ago

Looks good, thanks. Could you also document this enhancement here? https://github.com/containers/podman-compose/blob/main/podman_compose.py#L2051. E.g. When file is "-", standard input is read or anything better you can think of.

ArthoPacini commented 2 weeks ago

The final help message is "Specify an compose file (default: docker-compose.yml) or '-' to read from stdin."

It seems that the static check didn't allowed larger messages.

p12tic commented 2 weeks ago

It seems that the static check didn't allowed larger messages.

I think it would have allowed a string broken across multiple lines. Anyway, current message is enough.

ArthoPacini commented 2 weeks ago

It seems that on the resolve_extends function it also reads the docker-compose.yaml file using the yaml.safe_load() function. I don't know exactly what this function is doing, it seems to be called somewhere on the _parse_compose_file() function, so it might be wise to check that out and see if it needs the same kind of modification. For now, it works great I can pass docker-compose.yaml files via stdin. Keep up the good work!