-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to capture exec output to file or variable in bash #9104
Comments
might be a symptom related to #7346, though I was expecting to at least be able to pipe stderr to stdout and have it captured, and it used to work not even a month ago |
Can confirm it works as expected on version 2.2.2. Downgraded it using pacman cache and |
Tried to reproduce:
Did I missed something? |
That was supposed to reproduce the issue. Question is now why on my machine no matter what I did I was unable to capture exec output. Let me update docker-compose and try to reproduce again. |
ok, I can reproduce forcing use of compose as a CLI plugin:
|
Works as expected if you force exec to disable TTY:
relates to #9035 |
nice! thanks I will just fix my automation pipelines by adding |
Worked for me docker-compose exec --no-TTY ... |
I'm here because my GitHub Actions CI tests, which do basically
suddenly stopped printing any output when GitHub upgraded the build environment to Docker Compose 2.2.3.
|
I'm also here because my Bitbucket Pipelines tests, which do basically
suddenly stopped printing any output when I upgraded the build environment to Docker Compose 2.3.3. Docker Compose 2.2.2 does not have this issue with Bitbucket Pipelines. |
For me the issue got fixed by using Docker Compose 2.4.0. |
no output, |
This issue seems fixed with: |
Description
It used to be possible to just capture a
docker-compose exec
output and manipulate it later. Now even pipes in bash completely breaks because the command is not outputting to stdout anymore, and piping stderr to stdout doesn't work as a workaround.Steps to reproduce the issue:
docker-compose up -d nginx
docker-compose exec nginx echo true | grep false
will output true.Describe the results you received:
It is impossible to capture the output of the command anymore.
FOO=$(docker-compose exec nginx echo true) bash -c 'echo $FOO | grep false'
will output true. For a sanity check, just runFOO=$(echo true) bash -c 'echo $FOO | grep false'
and it outputs nothing.Describe the results you expected:
To be able to capture
docker-compose exec
command output in a variable, use it in a pipe or redirect to a file.Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Output of
docker info
:Additional environment details:
The text was updated successfully, but these errors were encountered: