Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* コンテナ間で環境変数を共有する [#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-e...
- https://docs.docker.com/compose/compose-file/#extension...
終了行:
* コンテナ間で環境変数を共有する [#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-e...
- https://docs.docker.com/compose/compose-file/#extension...
ページ名: