<p>“Image” needs to be at the same level as “build”.</p>

CC BY-SA 3.0
2017-07-05T00:31:55.623Z
2017-07-05T00:31:55.623Z
Corey Quinn
<p>What's wrong with the following spec? (Image parameter is here to tag resulting image).</p>

<p>version: '3'</p>

<pre><code>services:
   foo:
      build:
         image: foo/bar
         dockerfile: Dockerfile
         context: .
</code></pre>

<p>System output:</p>

<pre><code>services.foo.build contains unsupported option: 'image'
</code></pre>

<p><em>Versions: docker-compose: 1.14.0; Docker: 17.06.0-ce</em></p>

<docker-compose>
Error with docker-compose - image not supported?
Ta Mu
# Error with docker-compose - image not supported?

(Asked by: username_0 on 2017-07-04)

What's wrong with the following spec? (Image parameter is here to tag resulting image).
version: '3'
services:
   foo:
      build:
         image: foo/bar
         dockerfile: Dockerfile
         context: .

System output:
services.foo.build contains unsupported option: 'image'

Versions: docker-compose: 1.14.0; Docker: 17.06.0-ce

**Tags:** docker-compose


---

## 1 answers

### Answer by username_1 on 2017-07-05. Score: 7 | Accepted answer

“Image” needs to be at the same level as “build”.


---

