title: Retrieve a db_dump from a docker container
body: <p>Could anyone pls bring some clarification on this:<br />
  I have this yaml with several services</p>
  <pre><code>version: &quot;3.3&quot;
  services:
    db:
      image: postgres:11.6
      restart: always
      environment:
        ENV1: VAL1
        ENV2: VAL2
  </code></pre>
  <p>I need somehow to get the container name to create and retrieve a db_dump file from there. I can't use <code>docker ps</code> cause this happens in a github action. I have this string to do it:</p>
  <pre><code>docker exec -d $CONTAINER_ID pg_dump -f $db_dump_file $db_mame &amp;&amp; docker cp $CONTAINER_ID:[src_file] [dest_file]  
  </code></pre>
  <p>Any suggestions on how to get the $CONTAINER_ID  are appreciated.<br />
  Thank you in advance</p>