是否可以重复使用在多个容器之间共享的环境变量?
这个想法是为了避免重复,就像这个例子所示:
version: '2'
services:
db:
image: example/db
ports:
- "8443:8443"
container_name: db
hostname: db
environment:
- USER_NAME = admin
- USER_PASSWORD = admin
svc:
image: example/svc
depends_on:
- db
ports:
- "9443:9443"
container_name: svc
hostname: svc
environment:
- DB_URL = https://db:8443
- DB_USER_NAME = admin
- DB_USER_PASSWORD = admin
docker-compose.yml
中重复使用扩展字段进行替换? - Andrius