containers / containers/podman-compose
command overrides do not work when using the include directive
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When using the `include` directive in a compose YAML file the `command` block for a service is never overriden rather it remains the same as that of the original file.
**To Reproduce**
Here is a [Public Gist](https://gist.github.com/shantanoo-desai/89243ac937b0dbe475319c229dadc514) of a minimal reproducible example which captures and compares the bug and expected behavior of Docker Compose / Podman Compose
Here is the summarized code for re-production:
```yaml
# compose.service.yml
services:
test-svc:
image: docker.io/library/alpine:latest
command:
# trivial command (will never be executed)
- run
- test
```
```yaml
# compose.include.yml
include:
- compose.service.yml
```
```yaml
# compose.override.yml
services:
test-svc:
command:
# trivial command (will never be executed)
# override: run test -> run ALL test
- run
- ALL
- test
```
Steps to reproduce the behavior:
based on the Gist:
```bash
make -f Makefile.podman with-include
```
OR directly:
```bash
podman-compose -f compose.include.yml -f compose.override.yml config
```
**Expected behavior**
A clear and concise description of what you expected to happen.
The `podman-compose -f compose.include.yml -f compose.override.yml config` should override the commands based on the `compose.override.yml` file:
```bash
services:
test-svc:
command:
# trivial command (will never be executed)
# override: run test -> run ALL test
- run
- ALL
- test
```
**Actual behavior**
What is the behavior you actually got and that should not happen.
current output:
```bash
podman-compose -f compose.include.yml -f compose.override.yml config
services:
test-svc:
command:
- run
- test
image: docker.io/library/alpine:latest
```
**Environment:**
OS: Linux
Podman Version
```bash
$ podman version
Client: Podman Engine
Version: 5.6.0
API Version: 5.6.0
Go Version: go1.25.3 (Red Hat 1.25.3-1.el10_1)
Git Commit: b194cd996eb74ecf0ff67d710d4b2aaa90e1c27e
Built: Mon Jan 12 00:00:00 2026
Build Origin: Rocky Linux Build System
OS/Arch: linux/amd64
```
Podman Compose Version
```bash
$ podman-compose version
podman-compose version 1.5.0
podman version 5.6.0
```
**Additional context**
None
Contributor guide
Research direction
Start with Makefile.podman and the compose.include.yml/compose.override.yml reproduction, then trace how include processing and subsequent file overrides are merged. Confirm the current config output and add coverage for the command override; done means config reports run, ALL, test while retaining the included service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100