logs() hangs after container has quit
See original GitHub issueHi,
I’m using version 1.6 of docker-py on Python 3.4.3+ on Ubuntu 15.10
bash# pip3 freeze | grep docker-py && python3 --version && docker version
docker-py==1.6.0
Python 3.4.3+
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:20:08 UTC 2015
OS/Arch: linux/amd64
This hangs after my container finishes what it’s doing:
machine.start(container=backup)
for line in machine.logs(container=backup, stream=True):
log(line.decode("utf-8").strip(), name)
I don’t want to have to return to wrapping shell commands, uggg 😦
I have seen various closed issues related to this. Am I missing some subtlety in the docs or is this a problem again?
Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Find out Why Your Docker Container Keeps Crashing
Your Docker container is exiting without a useful error message? Here are a few ways to find out what's happening.
Read more >Why Does My Docker Container Stop? - Tutorial Works
When you run a container image you've pulled from a registry like Docker Hub, you're launching a process. This process will, eventually, complete....
Read more >docker-compose up hangs forever. How to debug?
Docker-compose seems to hang indefinitely when the system has low entropy. ... That will show you the interactive logs on the console.
Read more >Troubleshoot ECS tasks stopping or failing to start - AWS
To identify why your tasks stopped, follow these troubleshooting steps: Check for diagnostic information in the service event log.
Read more >Overview | Docker Documentation
This page contains information on: How to diagnose and troubleshoot Docker Desktop issues; Check the logs; Find workarounds for common problems ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am still seeing this issue with the latest version of the Docker client (2.5.1). Using
tty=True
plus the streaming fix by @darkermatter in https://github.com/docker/docker-py/issues/919#issuecomment-181815005 fixed it for us.Thanks Tomas,
I now have this working on Docker Engine 1.9.1 (I’ll test 1.10.0 later). As your code comment mentioned, stream is spitting out every character without buffering.