Answers: <p>“Image” needs to be at the same level as “build”.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-07-05T00:31:55.623Z
Answers: 2017-07-05T00:31:55.623Z
Answers: Corey Quinn
Body: <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>
  
Tags: <docker-compose>
Title: Error with docker-compose - image not supported?
UserDisplayName: Ta Mu
ThreadText: # 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”.
  
  
  ---
  
  