Azure build pipeline, docker compose - set environment variable
The "Environment Variables" in the Docker Compose task not inject the variables into the containers so the Java application can't read them, but they are will be available in the agent during the process.
The variables are for use in the docker-compose.yml
in this way: ${variableName}
.
So you can define in the Docker Compose task variable: FEATURE_LIST=blabla
and in the docker-compose.yml
inject the variable into the container:
image:ubuntu:latestenvironment: - FEATURE_LIST=${FEATURE_LIST}
In this way you can specify environment variables inside Azure Build Pipeline (but you must also define them in the docker-compose.yml
).