0

I have two Docker containers:

1 for Keepalived 1 for Haproxy

The problem is that my track_script killall -0 haproxy (to check if haproxy is still alive) can't reach the process of haproxy (because it is in another container..)

What should I do ?

Thanks!

Theo Cerutti
  • 779
  • 1
  • 10
  • 33

2 Answers2

0

Finally I mount bind the docker socket to run docker exec othercontainer killall -0 haproxy in my container.

Not the best method but.. it works

Theo Cerutti
  • 779
  • 1
  • 10
  • 33
-1

Nothing. If the main process in a container exits, the container will exit too; Docker does this automatically, and you shouldn't (and for the most part can't) check on an individual process in another container.

You can use a restart policy to have Docker automatically restart a container, and its contained process, if it happens to exit:

docker run -d --restart on-failure ... haproxy
David Maze
  • 130,717
  • 29
  • 175
  • 215