skip to Main Content

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!

2

Answers


  1. Chosen as BEST ANSWER

    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


  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search