docker-compose.yml invalid: app.build contains an invalid type, it should be a string
<p>Running <code>$ docker-compose up</code> when I have my <code>docker-compose.yml</code> as the following, everything works as expected:</p>

<pre><code>app:
  build: . 
</code></pre>

<p>However when I have <code>docker-compose.yml</code> as (which appears to valid within the <a href="https://docs.docker.com/compose/compose-file/#build" rel="noreferrer">docker-compose reference</a>):</p>

<pre><code>app:
  build:
    context: .
</code></pre>

<p>I get the following <strong>error:</strong></p>

<pre><code>$ docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
app.build contains an invalid type, it should be a string
</code></pre>

<p>I've also tried <code>context: "."</code> with no joy. Please help! Many thanks.</p>