Skip to content

Instantly share code, notes, and snippets.

@dims
Created December 22, 2014 13:20
Show Gist options
  • Select an option

  • Save dims/c3327f633c526847c8e5 to your computer and use it in GitHub Desktop.

Select an option

Save dims/c3327f633c526847c8e5 to your computer and use it in GitHub Desktop.
simple docker-py client to stream logs
import docker
base_url = 'unix://var/run/docker.sock'
print(">>>>>> CLIENT")
client = docker.Client(base_url=base_url,
version='1.14',
timeout=10)
print(">>>>>> CLIENT LOGS")
log_stream = client.logs('20ce0b3c8f5d', stream=True)
print(">>>>>> LOG STREAM")
for line in log_stream:
print(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment