containers / containers/podman-compose

podman-compose exec with --detach option fails to detach

Open
#1,335 0 comments 0 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**
Running podman-compose exec with --detach option doesn't remove the --interactive option from the underlying podman exec call.

**To Reproduce**
Steps to reproduce the behavior:
1. Bring up a pod with daemonic services (i.e.: podman compose up -d)
2. Attempt to exec a command or script on one of the daemonic services with podman-compose exec -d

**Expected behavior**
Command runs in the background and returns to the calling shell immediately.

**Actual behavior**
Command runs in the foreground of the calling shell, blocking until exec completion.

**Output**

```
$ podman-compose --verbose -p aflpp_gif2png exec --detach -T devenv /bin/bash -c "echo 'test'"
INFO:podman_compose:['podman', '--version', '']
INFO:podman_compose:using podman version: 5.4.0
INFO:podman_compose:podman exec --interactive --env EXT_USR_ID= --env EXT_GRP_ID= aflpp_gif2png_devenv_1 /bin/bash -c echo 'test'
test

$ podman-compose --verbose -p aflpp_gif2png exec --detach devenv /bin/bash -c "echo 'test'"
INFO:podman_compose:['podman', '--version', '']
INFO:podman_compose:using podman version: 5.4.0
INFO:podman_compose:podman exec --interactive --tty --env EXT_USR_ID= --env EXT_GRP_ID= aflpp_gif2png_devenv_1 /bin/bash -c echo 'test'
test
...

```

**Environment:**
- OS: Ubuntu 24.04
- podman version: 5.4.0
- podman compose version: v1.5.0 (pulled with pipx) (probably f7eeda1a3db10952424af6a5b0501c269ebe3f0d)

**Additional Notes**
Alternatively, I'd use podman-compose run, since detach works with that command, but I'm also trying to run my containers with podman-compose up -d --scale.

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.