Docker environment variables (-e / --env-file) Explained

What Docker environment variables (-e / --env-file) does, with an example.

Published November 10, 2026

Docker environment variables (-e / --env-file) pass configuration into a container at runtime without baking values into the image itself.

Key points

  • Part of the standard Docker CLI used for building, running, and managing containers

Example

docker run -e NODE_ENV=production myapp
More General articles