How do I use the variables defined in Docker for use in PHP?
Example in Docker:
$ docker run -d my_container -e MYSQL_CONNECT="{host:'x', port:'x'}"
Example in PHP:
$_ENV['MYSQL_CONNECT']
I've searched, but could not find anything concrete.
How do I use the variables defined in Docker for use in PHP?
Example in Docker:
$ docker run -d my_container -e MYSQL_CONNECT="{host:'x', port:'x'}"
Example in PHP:
$_ENV['MYSQL_CONNECT']
I've searched, but could not find anything concrete.
you need to provide the environment variables before the image name, like this:
$ docker run -d -e MYSQL_CONNECT="{host:'x', port:'x'}" my_container