Docker - Define environment variables in a container using the docker run -e or --env command
by
Jeremy Canfield |
Updated: February 13 2022
| Docker articles
This assumes you have installed Docker on Linux and Docker is running.
The -e or --env option can be used to define environment variables. In this example, when using the docker run command to create snd start the Hello world container, the "foo" variable contains a value of "bar". This assumes that the Hello world service is configured to use the foo variable.
docker run --env foo=bar hello-world
Did you find this article helpful?
If so, consider buying me a coffee over at