Commit 1c8b7c32 authored by José Henrique's avatar José Henrique
Browse files

Try to fix EOF when trying to read logs

parent 339aa1de
......@@ -55,9 +55,13 @@ def pull_image(image_name):
def stream_container_logs_thread(container_name):
time.sleep(10)
try:
container = docker_client.containers.get(container_name)
for line in container.logs(stream=True):
print(line.strip().decode("utf-8"))
while True:
container = docker_client.containers.get(container_name)
for line in container.logs(stream=True):
line = line.strip().decode("utf-8")
if "Error grabbing logs: unexpected EOF" in line:
break
print(line)
except docker.errors.NotFound:
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment