title: How do I start a docker container in Docker-Compose from an app running in another docker container
body: <p>I have two apps/services that I want to run under docker-compose. (AppA and AppB)</p>
  <p>I would like to have AppA start when I run docker-compose up, but not AppB. And after various conditions are met, I want AppA (which is a Go app in the docker container) to start up AppB's docker container.</p>
  <p>My docker-compose.yml file defines both services, and if launch with the command:</p>
  <pre><code>docker-compose up
  </code></pre>
  <p>Both AppA and AppB start running. (So I believe my docker-compose.yml is correctly configured)
  If I want to run only AppA (and I do want that!) I run this command:</p>
  <pre><code>docker-compose up AppA
  </code></pre>
  <p>And only AppA will start up. (So far all good.)</p>
  <p>When I reach the point where I want to start AppB, I have AppA call the following from golang code:</p>
  <pre><code>cmd := exec.Command(&quot;docker run AppB&quot;)
  </code></pre>
  <p>or</p>
  <pre><code>cmd := exec.Command(&quot;docker-compose start AppB&quot;)
  </code></pre>
  <p>Both of these generate an error:</p>
  <pre><code>Error: fork/exec docker run AppB: no such file or directory.
  </code></pre>
  <p>Any ideas on how to launch a docker container from a Go app inside another docker container?</p>