Docker - Define environment variables in Dockerfile using ENV

by
Jeremy Canfield |
Updated: September 11 2022
| Docker articles
This assumes you have installed Docker on Linux and Docker is running.
The ENV option can be used to define environment variables in an image using a Dockerfile. In this example, the "foo" variable contains a value of "bar".
FROM jeremycanfield/hello-world:latest
ENV foo=bar
Did you find this article helpful?
If so, consider buying me a coffee over at