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?

@dnephin dnephin added this to the 1.6.0 milestone Nov 13, 2015
@dnephin dnephin force-pushed the docker_compose_events branch from b531c90 to 244dc60 Compare November 13, 2015 21:47
@dnephin dnephin force-pushed the docker_compose_events branch from 244dc60 to 1cc24f1 Compare November 21, 2015 00:31
@dnephin dnephin changed the title WIP: docker-compose events docker-compose events Nov 21, 2015
@dnephin dnephin force-pushed the docker_compose_events branch from 1cc24f1 to a6b303e Compare November 23, 2015 20:01
@dnephin dnephin force-pushed the docker_compose_events branch from a6b303e to 20b6486 Compare January 7, 2016 18:22
Signed-off-by: Daniel Nephin <dnephin@docker.com>
@dnephin dnephin force-pushed the docker_compose_events branch from 20b6486 to f843616 Compare January 8, 2016 23:07
@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 dnephin force-pushed the docker_compose_events branch from f843616 to d3cd038 Compare January 11, 2016 16:51
@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.

4 participants