title: docker exec not working in docker-compose containers
body: <p>I'm executing two docker containers using docker compose.</p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED                 STATUS              PORTS                                                                                                                                   NAMES
  eef95ca1b59b        gogent_qaf          "/bin/sh -c ./slave.s"   14 seconds ago      Up 12 seconds       4242/tcp, 7000-7005/tcp, 9999/tcp, 0.0.0.0:30022-&gt;22/tcp                                                                                coreqafidm_qaf_1
  a01373e893eb        gogent_master       "/bin/sh -c ./master."   15 seconds ago      Up 13 seconds       4242/tcp, 0.0.0.0:27000-&gt;7000/tcp, 0.0.0.0:27001-&gt;7001/tcp, 0.0.0.0:27002-&gt;7002/tcp, 0.0.0.0:27003-&gt;7003/tcp, 0.0.0.0:29999-&gt;9999/tcp   coreqafidm_master_1
  </code></pre>
  
  <p>When I try to use:</p>
  
  <pre><code>docker exec -it coreqafidm_qaf_1 /bin/bash 
  </code></pre>
  
  <p>I get the error: </p>
  
  <pre><code>docker exec -it coreqafidm_qaf_1 /bin/bash
  no such file or directory
  </code></pre>
  
  <p>Here is the docker-compose file:</p>
  
  <pre><code>version: '2'
  services:
    master:
      image: gogent_master
      volumes:
        - .:/d1/apps/qaf
        - ./../core-idm-gogent/:/d1/apps/gogent
      ports:
        - "27000-27003:7000-7003"
        - "29999:9999"
      build:
        context: .
        dockerfile: Dockerfile.master
    qaf:
      image: gogent_qaf
      ports:
        - "30022:22"
      volumes:
        - .:/d1/apps/qaf
        - ./../core-idm-gogent/:/d1/apps/gogent
      depends_on: [master]
      build:
        context: .
        dockerfile: Dockerfile.qaf
  </code></pre>
  
  <p>Both Docker files involved have as their last WORKDIR command:</p>
  
  <pre><code>WORKDIR /d1/apps/qaf
  </code></pre>
  
  <p>If there is a REAL directory /d1/apps/qaf on the machine's natural file system docker exec works, to some degree. It will open up a shell. However, the mapped in volumes are not available to this shell and the files I see are the ones in the real, natural directory, not what should be the mapped in volume.</p>
  
  <pre><code>$ mkdir /d1/apps/qaf
  $ docker exec -it coreqafidm_qaf_1 /bin/bash
  root@eef95ca1b59b:/d1/apps/qaf#
  root@eef95ca1b59b:/d1/apps/qaf# ls /d1/apps/gogent
  ls: cannot access /d1/apps/gogent: No such file or directory
  </code></pre>
  
  <p>The volumes work correctly from within the docker-compose context. I have scripts executing in their and they work. It's just docker exec that fails to see the volumes.</p>