title: Restart a docker container from another running container
body: <p>I am using docker-compose for deployment.
  I want to restart my "centos-1" container from "centos-2" container. Both containers are running on the same host.
  Please suggest, How could I achieve this in a simplest and automated way?</p>
  
  <p>I followed <a href="https://stackoverflow.com/questions/32163955/how-to-run-shell-script-on-host-from-docker-container">How to run shell script on host from docker container?</a> and tried to run a script on Host from "centos-2" container, but the script is executing inside a container and not on the host.</p>
  
  <p>Script:</p>
  
  <pre><code>    #!/bin/bash
      sudo docker container restart centos-1
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>    line 2: docker: command not found
  </code></pre>
  
  <p>(Docker isn't installed inside any centos-2 container)</p>