Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose events #2392

Merged
merged 2 commits into from
Jan 12, 2016
Merged

docker-compose events #2392

merged 2 commits into from
Jan 12, 2016

Conversation

dnephin
Copy link

@dnephin dnephin commented Nov 13, 2015

Fixes #1510

Adds a new command events for tailing the event stream for containers in the composition.

The event fields match the new api fields being introduced in 1.10 (moby/moby#18888)

This gist shows an example of using these events to create event hooks in under 20 lines of bash:
https://gist.github.com/dnephin/c56b479810f863527e90

Any suggestion on where this can be included in the docs?

Signed-off-by: Daniel Nephin <dnephin@docker.com>
@dnephin
Copy link
Author

dnephin commented Jan 8, 2016

I've updated this PR, and included an example of using the events to create the often requested "hooks" feature in the description.

@dnephin
Copy link
Author

dnephin commented Jan 11, 2016

I've noticed that I have to use PYTHONUNBUFFERED=1 to get these to flush properly. We might need to add some force flushing to stdout.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
@dnephin
Copy link
Author

dnephin commented Jan 11, 2016

Ok, I've added the flush() so that users won't have to know about PYTHONUNBUFFERED=1

@aanand
Copy link

aanand commented Jan 12, 2016

Nice. Tested locally, looks great.

LGTM

aanand added a commit that referenced this pull request Jan 12, 2016
@aanand aanand merged commit 063a25a into docker:master Jan 12, 2016
@dnephin dnephin deleted the docker_compose_events branch January 12, 2016 14:33
@CodeTahoe
Copy link

@dnephin re: docs - Maybe it can go in it's own section as "events" under bash completion under the heading of "create multi-container applications"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants