Created
December 22, 2014 13:20
-
-
Save dims/c3327f633c526847c8e5 to your computer and use it in GitHub Desktop.
simple docker-py client to stream logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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