#author("2019-04-02T05:50:29+09:00","default:ryuichi","ryuichi")
#author("2019-04-02T05:52:48+09:00","default:ryuichi","ryuichi")
* コンテナ間で環境変数を共有する [#aa3c9485]

 version: '3.4'
 
 x-common-variables: &common-variables
   VARIABLE: some_value
   ANOTHER_VARIABLE: another_value
 
 services:
   some_service:
     image: someimage
     environment: *common-variables
 
   another_service:
     image: anotherimage
     environment:
       <<: *common-variables
       NON_COMMON_VARIABLE: 'non_common_value'


- x-●●●で共有名を作り、&●●●で定義する
- 各コンテナのenvironmentで*●●●で参照展開する
- ということらしい

** 参考 [#e1e5d332]

https://stackoverflow.com/questions/36283908/re-using-environmental-variables-in-docker-compose-yml

- https://stackoverflow.com/questions/36283908/re-using-environmental-variables-in-docker-compose-yml
- https://docs.docker.com/compose/compose-file/#extension-fields

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS