docker -H :4000 events | ./docker_events.py

docker -H :4000 events will gives the events continuously until we press Crtl+C. So, I pipe the output to my custom script docker_events.py which parses the output which was returned by docker -H :4000 events and then gives it own version of output (actually it will send json data to redis!)

I inclued the above line in supervisord .conf like below

command=docker -H :4000 events | python /root/docker_events.py

but it is not working properly; I can see error in docker_events.err.log

Usage:  docker events [OPTIONS]

Get real time events from the server
docker: "events" requires 0 arguments.
See 'docker events --help'.

It is taking | as argument. So can I resolve this issue?

1 Answer 1


You use the shell piping and it is not handled properly in your config file. My guess a correct command might be

command=bash -c "docker -H :4000 events | python /root/docker_events.py"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .