title: Why docker-compose needs compose file for exec command?
body: <p>I have a bash script which located above directory in which docker-compose.yaml presents.</p>
  
  <p>Inside bash script there is command:</p>
  
  <pre><code>docker-compose exec ${service} /somescript_inside_container.sh
  </code></pre>
  
  <p>When executing this bash script I'm getting:</p>
  
  <pre><code>ERROR: 
          Can't find a suitable configuration file in this directory or any
          parent. Are you in the right directory?
  
          Supported filenames: docker-compose.yml, docker-compose.yaml
  </code></pre>
  
  <p>But when running this command with docker and referencing <code>container_name</code> instead of <code>service</code> e.g.</p>
  
  <pre><code>docker exec ${container_name} /somescript_inside_container.sh
  </code></pre>
  
  <p>It will work.</p>
  
  <p>For me it's not obvious behavior and I'm curious why is there such difference between docker and docker-compose ?</p>