I want to monitor events from my docker daemon in a C application, but I'm unclear how to subscribe to that API. This is probably just a Rest API in C question. All of the examples I find with Docker do a single call and response.
Asked
Active
Viewed 236 times
1 Answers
0
I feel like there should be a better way to do this, but it's possible to just read off chunks of events from the stream:
echo -e "GET /v1.20/events?since=1500032589&until=1500035000 HTTP/1.1\r\nHost:\r\n" | nc -U /var/run/docker.sock
You just need to track the time, and realize that until
is non-inclusive.

Coop
- 189
- 1
- 15