Reuse image built by one service in another service : <p>Let's say I have this project structure:</p>

<pre><code>proj/
├── docker
│   └── myservice
│       └── Dockerfile
└── docker-compose.yml
</code></pre>

<p>And this is my <code>docker-compose.yml</code>: </p>

<pre><code>version: '3'

services:

  master:
      build: docker/myservice

  slave:
      image: proj_master
      depends_on: master
</code></pre>

<p>I want the <code>master</code> service to create an image, which will be used by the <code>master</code> and the <code>slave</code> services (with different parameters, not shown here). By trial and error I have found out that the slave must refer to the image <code>proj_master</code>.</p>

<ul>
<li>Where is this documented?</li>
<li>Why do I need to make a reference to the <code>proj</code>? Usually a docker composer file is agnostic related to where it is located ...</li>
</ul>
