Browse Source

Merge pull request #3022 from aanand/update-build-image-extends-note

Update note about build + image with extends
Daniel Nephin 9 years ago
parent
commit
4db1fef58c
1 changed files with 11 additions and 25 deletions
  1. 11 25
      docs/extends.md

+ 11 - 25
docs/extends.md

@@ -290,31 +290,17 @@ replaces the old value.
     # result
     command: python otherapp.py
 
-In the case of `build` and `image`, using one in the local service causes
-Compose to discard the other, if it was defined in the original service.
-
-Example of image replacing build:
-
-    # original service
-    build: .
-
-    # local service
-    image: redis
-
-    # result
-    image: redis
-
-
-Example of build replacing image:
-
-    # original service
-    image: redis
-
-    # local service
-    build: .
-
-    # result
-    build: .
+> **Note:** In the case of `build` and `image`, when using
+> [version 1 of the Compose file format](compose-file.md#version-1), using one
+> option in the local service causes Compose to discard the other option if it
+> was defined in the original service.
+>
+> For example, if the original service defines `image: webapp` and the
+> local service defines `build: .` then the resulting service will have
+> `build: .` and no `image` option.
+>
+> This is because `build` and `image` cannot be used together in a version 1
+> file.
 
 For the **multi-value options** `ports`, `expose`, `external_links`, `dns` and
 `dns_search`, Compose concatenates both sets of values: