helpful-butcher-75556
09/30/2022, 2:19 PMservices:
busybox:
container_name: busybox
image: busybox
env_file: .env-compose
environment:
ZA: "in compose"
profiles:
- test
command: ['sh', '-c', 'set']
I have .env and .env-compose files as shown below, and set local environment variables ZA=OS and ZB=OS
; .env file
ZA=.env file
ZB=.env file
ZC=.env file
.env-compose
ZA=.env-compose file
ZB=.env-compose file
ZC=.env-compose file
ZD=.env-compose file
busybox | ZA='in compose'
busybox | ZB='OS'
busybox | ZC=.'env file'
busybox | ZD=.env-compose file'
Note that the priority is:
1. environment in compose
2. the environment variable at the CLI
3. the .env file
4. the .env-composebusybox | ZA='in compose'
busybox | ZA='in compose'
busybox | ZB='OS'
busybox | ZC='.env file'
dockerd
so I can play with compose Profiles and this is on an M1 Mac.busybox |ZA='in compose'
busybox |ZB='.env-compose file'
busybox |ZC='.env-compose file'
busybox |ZD='.env-compose file'