containers / containers/podman-compose

Podman-compose build doesn't work with Containerfile after v1.1.0

Open
#1,089 1 comment 3 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
As per https://github.com/containers/podman-compose/issues/167 `podman-compose build` should works with Dockerfile as well as with Containerfile

version 1.0.6 works
versions 1.1.0 and 1.2.0 give error:
`OSError: Dockerfile not found in `

**To Reproduce**
compose.yaml:
```
services:
web:
build: ./web
```
file `Containerfile` in web folder.

**Expected behavior**
with version 1.0.6:
```
❯ podman-compose build
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 5.3.1
podman build -f ./web/Containerfile -t devops_web ./web
STEP 1/10: FROM registry.access.redhat.com/ubi9/ubi:9.5
```
**Actual behavior**
with versions 1.1.0 and 1.2.0:
```
❯ podman-compose build
Traceback (most recent call last):
File "/usr/local/bin/podman-compose", line 8, in
sys.exit(main())
~~~~^^
File "/usr/local/Cellar/podman-compose/1.2.0/libexec/lib/python3.13/site-packages/podman_compose.py", line 3504, in main
asyncio.run(async_main())
~~~~~~~~~~~^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 194, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/usr/local/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 720, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/usr/local/Cellar/podman-compose/1.2.0/libexec/lib/python3.13/site-packages/podman_compose.py", line 3500, in async_main
await podman_compose.run()
File "/usr/local/Cellar/podman-compose/1.2.0/libexec/lib/python3.13/site-packages/podman_compose.py", line 1743, in run
retcode = await cmd(self, args)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/podman-compose/1.2.0/libexec/lib/python3.13/site-packages/podman_compose.py", line 2422, in compose_build
s = await t
^^^^^^^
File "/usr/local/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/tasks.py", line 634, in _wait_for_one
return f.result() if resolve else f
~~~~~~~~^^
File "/usr/local/Cellar/podman-compose/1.2.0/libexec/lib/python3.13/site-packages/podman_compose.py", line 2373, in build_one
raise OSError("Dockerfile not found in " + ctx)
OSError: Dockerfile not found in /Users/maxim/Projects/DevOps/web
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.