This page talks about Environment variable in dockerfile.
ENV <key> <value>
ENV <key>=<value>
# example
ENV myName John Doe
ENV myDog Rex The Dog
ENV myCat fluffy
docker run --env <key>=<value>
Docker variable expansion works the same than variable 2)
Environment variables are notated
$variable_name
#or the brace syntax is typically used to address issues with variable names with no whitespace, like ${foo}_bar.
${variable_name}
The variable_name syntax also supports a few of the standard bash modifiers as specified below:
In all cases, word can be any string, including additional environment variables.
Escaping is possible by adding a \ before the variable: \foo or \foo, for example, will translate to foo and foo literals respectively.