Переглянути джерело

Clarify environment and env_file docs

Add note to say that environment variables will not be automatically
made available at build time, and point to the `args` documentation.

Signed-off-by: Aanand Prasad <[email protected]>
Aanand Prasad 9 роки тому
батько
коміт
907b0690e6
1 змінених файлів з 10 додано та 0 видалено
  1. 10 0
      docs/compose-file.md

+ 10 - 0
docs/compose-file.md

@@ -276,6 +276,11 @@ beginning with `#` (i.e. comments) are ignored, as are blank lines.
     # Set Rails/Rack environment
     RACK_ENV=development
 
+> **Note:** If your service specifies a [build](#build) option, variables
+> defined in environment files will _not_ be automatically visible during the
+> build. Use the [args](#args) sub-option of `build` to define build-time
+> environment variables.
+
 ### environment
 
 Add environment variables. You can use either an array or a dictionary. Any
@@ -295,6 +300,11 @@ machine Compose is running on, which can be helpful for secret or host-specific
       - SHOW=true
       - SESSION_SECRET
 
+> **Note:** If your service specifies a [build](#build) option, variables
+> defined in `environment` will _not_ be automatically visible during the
+> build. Use the [args](#args) sub-option of `build` to define build-time
+> environment variables.
+
 ### expose
 
 Expose ports without publishing them to the host machine - they'll only be