-
Notifications
You must be signed in to change notification settings - Fork 0
How to set and use variable in docker compose
Jack edited this page Mar 21, 2022
·
4 revisions
It follows the Linux shell mechanism, like that
export variable
read a manual
# docker-compose --help
--env-file string Specify an alternate environment file.
Load
.env
file, if it is on directory that you command docker-compose`s CLI
export VARIABLE=VALUE
VARIABLE=VALUE
Is is shell mechanism for using variable
#docker-compose.yaml
version: '3'
services:
your-service:
image: your-imange:${VARIABLE}