When I run my docker image normally like so
docker run -v ..... {DOCKER_IMAGE}
I get my log in the terminal as expected. But running like so:
docker_client = docker.from_env()
container = docker_client.containers.run(DOCKER_IMAGE, None, environment=[f'foo={self.profile}'],
volumes={...,}, auto_remove=True, stderr=True, stdout=True)
# No logs show up
Seems to suppress logs. How can I get the log output while it's running? Can I stream the docker container run?
I can do this
docker_client.containers.run(.... detach=True)
for line in container.logs(stream=True):
print(line)
But this loses whether it's a debug/info/warning/error