containers / containers/podman-compose
podman-compose ignores dockerfile setting
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
podman-compose does ignore the dockerfile setting
**To Reproduce**
```
mkdir foo && cd foo && echo -e 'services:\n something:\n build:\n dockerfile: foo.Dockerfile\n context: .' >compose.yml && echo -e 'FROM docker.io/alpine:latest\n\nRUN touch abc' >foo.Dockerfile && echo -e '\ntry\n' && podman-compose build || { echo -e '\ntry with renamed file but same compose config\n' && mv foo.Dockerfile Dockerfile && podman-compose build; }
```
**Expected behavior**
"try" should succeed
"try with renamed file but same compose config" should not be executed and if, then it should not succeed
**Actual behavior**
for "try"
> `Error: no Containerfile or Dockerfile specified or found in context directory, [redacted}\foo: The system cannot find the file specified.`
for "try with renamed file but same compose config" the output that should come for "try".
**Output**
```
$ podman-compose version
podman-compose version 1.6.0
podman version 6.0.2
$ mkdir foo && cd foo && echo -e 'services:\n something:\n build:\n dockerfile: foo.Dockerfile\n context: .' >compose.yml && echo -e 'FROM docker.io/alpine:latest\n\nRUN touch abc' >foo.Dockerfile && echo -e '\ntry\n' && podman-compose build || { echo -e '\ntry with renamed file but same compose config\n' && mv foo.Dockerfile Dockerfile && podman-compose build; }
try
Error: no Containerfile or Dockerfile specified or found in context directory, [redacted]\foo: The system cannot find the file specified.
try with renamed file but same compose config
STEP 1/2: FROM docker.io/alpine:latest
STEP 2/2: RUN touch abc
--> Using cache 7b73b80737a73b3237548e2b9eef0a167e0bdb67effd0b3876bb26aaf1b4fbdd
COMMIT foo_something
--> 7b73b80737a7
Successfully tagged localhost/foo_something:latest
7b73b80737a73b3237548e2b9eef0a167e0bdb67effd0b3876bb26aaf1b4fbdd
```
**Environment:**
- OS: Windows 11 with WSLv2
- podman version: 6.0.2
- podman compose version: 1.6.0
Contributor guide
Research direction
Start by running the provided Windows/WSLv2 reproduction with podman-compose 1.6.0 and compare the build behavior for foo.Dockerfile versus Dockerfile. Trace the compose build handling for the dockerfile and context settings. Done means the configured foo.Dockerfile is used successfully, while renaming it to Dockerfile does not hide the configuration error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100