Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman compose -f does not resolve paths #1167

Open
kushuh opened this issue Mar 16, 2025 · 7 comments
Open

Podman compose -f does not resolve paths #1167

kushuh opened this issue Mar 16, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@kushuh
Copy link

kushuh commented Mar 16, 2025

Describe the bug

podman compose -f {FILENAME} fails if the file is not directly located within the directory that runs the command.

/root
  /subdir
    podman-compose.yaml

This will fail

cd /root && podman compose -f ./subdir/podman-compose.yaml up -d
# Throws FileNotFoundError: [Errno 2] No such file or directory

But this works

cd /root/subdir && podman compose -f podman-compose.yaml up -d
# Success

Output

$ podman compose -p authentication-test -f "./build/podman-compose.test.yaml" up -d
>>>> Executing external compose provider "podman-compose". Please see podman-compose(1) for how to disable this message. <<<<

Traceback (most recent call last):
  File "/home/kushuh/.local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/kushuh/.local/pipx/venvs/podman-compose/lib/python3.11/site-packages/podman_compose.py", line 3711, in main
    asyncio.run(async_main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/kushuh/.local/pipx/venvs/podman-compose/lib/python3.11/site-packages/podman_compose.py", line 3707, in async_main
    await podman_compose.run()
  File "/home/kushuh/.local/pipx/venvs/podman-compose/lib/python3.11/site-packages/podman_compose.py", line 1859, in run
    self._parse_compose_file()
  File "/home/kushuh/.local/pipx/venvs/podman-compose/lib/python3.11/site-packages/podman_compose.py", line 1954, in _parse_compose_file
    with open(filename, "r", encoding="utf-8") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './build/podman-compose.test.yaml'
Error: executing podman-compose -p authentication-test -f ./build/podman-compose.test.yaml up -d: exit status 1
$ ls ./build
podman-compose.test.yaml  podman-compose.yaml

Environment:

  • OS: WSL2
  • podman version: 5.4.0
  • podman compose version: 1.3.0
@kushuh kushuh added the bug Something isn't working label Mar 16, 2025
@banditopazzo
Copy link
Contributor

I have the same issue

@rafalkrupinski
Copy link

same on real Linux ;)
5.4.1/1.3.0

@banditopazzo
Copy link
Contributor

I quickly tested the actual main branch on my machine (real linux 😉) and for me it works without any issue. as a workaround I am temporary using it until a new release

@jfernandorh
Copy link

Same on Fedora CoreOS
Fedora CoreOS 41.20250302.3.2
podman-compose version 1.3.0
podman version 5.4.0

@kushuh
Copy link
Author

kushuh commented Mar 21, 2025

It looks like a path resolution issue. If it can help anyone, I use an absolute path as a temporary workaround.

podman compose -f "$PWD/subdir/podman-compose.yaml" up -d

@pofl
Copy link

pofl commented Mar 24, 2025

Also broken on Fedora Workstation
Linux fedora 6.13.7-200.fc41.x86_64
podman-compose version 1.3.0
podman version 5.4.1

@nurislam03
Copy link

Broken for:
podman-compose version 1.3.0
podman version 5.4.0
OS/Arch: darwin/arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants