I want to show an env var in my docker container. The PHP script looks like this:
<html>
<head>
<title>Show Use of environment variables</title>
</head>
<body>
<?php
print "env is: ".$_ENV["USER"]."\n";
?>
</body>
</html>
I use OpenShift to start the container. The PHP - container shows:
env is:
Now I change the dc config of my container:
oc env dc/envar USER=Pieter
deploymentconfig "envar" updated
When I access the container. The env var of USER is Pieter
docker exec -it 44a0f446ae36 bash
bash-4.2$ echo $USER
Pieter
But my script remains showing: "env is:
" It does not fill in the variable.