-
Notifications
You must be signed in to change notification settings - Fork 549
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Wrong parsing of a compose file leads to an error preventing the container to start, whereas it's parsed fine in docker-compose.
To Reproduce
Given this small compose file:
services:
a_test:
image: alpine:latest
environment:
- A_DIR="${A_DIR:-/a_dir_from_env}"
command: ["sh", "-c", "echo 'This is a test container.' && sleep 3600"]
volumes:
- ${A_DIR:-/tmp/a_dir_from_volume}:/a_dir$ podman_compose.py -f bug-compose.yml run --rm a_test
File "/home/jwendell/src/others/podman-compose/podman_compose.py", line 2529, in _parse_compose_file
raise RuntimeError(f"volume [{vol_name}] not defined in top level")
RuntimeError: volume ["/a_dir_from_env"] not defined in top levelAFAICT, the parser is considering the environment variable defined within environment: section to populate the variable in the volumes: section.
Using docker-compose, the container successfully starts and uses the host's dir /tmp/a_dir_from_volume as the source, and sets the variable correctly:
$ docker exec -it ci-a_test-run-a7a3f5c654b8 sh
/ # echo $A_DIR
"/a_dir_from_env"
/ # I'm using podman-compose main branch as of today on Fedora 42.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working