You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a project using docker compose up and subsequently creating a one-off container using docker compose run <service>, running docker exec <service> will use the one-off container if a) it is newer than the managed container or b) the managed container is not running.
docker compose up --detach
docker compose run --detach bug yes
docker compose exec bug ps -ef
docker compose down
docker compose exec bug ps -ef
The output of both exec commands should show yes in the process list, indicating that it's running within the one-off container. I would expect it to either a) run in the managed container (sleep would be in the process list) or b) print service "bug" is not running and exit.
I'm not sure if it's a bug or not but I changed the logic so if we have both containers(non one-off and one-off), then choose the non one-off container. #11995
Actually docker compose exec should not target one-off containers, this seems like a bug we introduced, maybe some user start to rely on so #11995 could be a reasonable workaround
Description
When running a project using
docker compose up
and subsequently creating a one-off container usingdocker compose run <service>
, runningdocker exec <service>
will use the one-off container if a) it is newer than the managed container or b) the managed container is not running.Steps To Reproduce
Using the following
docker-compose.yaml
:Run the following commands:
The output of both
exec
commands should showyes
in the process list, indicating that it's running within the one-off container. I would expect it to either a) run in the managed container (sleep
would be in the process list) or b) printservice "bug" is not running
and exit.Compose Version
Docker Environment
Anything else?
Possibly related: #10359
The text was updated successfully, but these errors were encountered: