Docker and CI/CD · Middle · Question 18 of 75

In Compose, what is the difference between the .env file and env_file:?

Explanation

The project .env is used for interpolation in compose.yaml. Variables reach the container only through environment: or env_file:.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 18

Test yourself

Take the Docker and CI/CD · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz