how to get STDOUT when the container exit with non-zero code?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
I run a command in a container with containers.run() method, when an error happened, the container returns a non-zero code, then I can only see the contents og STDERR in ContainerError.
If I correctly understood the codes, when a container exit with non-zero code, it firstly clean the out variable, and collect all STDERR and pass it to ContainerError object.

I would like to see the STDOUT messages before the error happened, is there a way to do that?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the containers.run() call and the ContainerError behavior described in the issue, then reproduce a non-zero exit with output on both streams. Check whether stdout is discarded before the error is raised. Done means callers can access the stdout produced before failure while still receiving the non-zero exit error and stderr.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100