Docker · Option
environment
Set variables in Compose with environment, or load them from files with env_file. Use docker compose run -e for a temporary value on one command.
Last updated
Syntax
services:
<service>:
environment:
NAME: value
env_file: path/to/file.envIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
environmentenv_filedocker compose run --envdocker run --env-filesecrets