I have noticed that in some Dockerfile the environment variables are specified using particular expressions, that perform some sort of variable substitution, such as:
ENV PASSWORD **Random**
ENV NAME **False**
I cannot find any reference to those expression in the Docker official documentation.
Where I can find a list of possible expressions that can be used in a Dockerfile and what is their meaning?
It's non-official convention to use these variables as template variables. They will be replaced in run-time.
Or you can replace them using -e
switch of docker run
.
For example:
ENV MYSQL_USER admin
ENV MYSQL_PASS **Random**
# Replication ENV
ENV REPLICATION_MASTER **False**
ENV REPLICATION_SLAVE **False**
If you take a look on start script you can see the following:
if [ "$MYSQL_PASS" = "**Random**" ]; then
unset MYSQL_PASS
fi
PASS=${MYSQL_PASS:-$(pwgen -s 12 1)}
If variable value is **Random**
let's replace it with a randomly generated password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With