0
I have this next dockerfile:
...
ENV REMOTE_HOST abcd
RUN figlet SETTING__XDEBUG__php.ini
RUN { \
echo '[xdebug]'; \
echo 'zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so'; \
echo 'xdebug.remote_enable=1'; \
echo 'xdebug.remote_port=9000'; \
echo 'xdebug.remote_autostart=1'; \
echo 'xdebug.remote_handler=dbgp'; \
echo 'xdebug.idekey=dockerdebug'; \
echo 'xdebug.profiler_output_dir="/var/www/html"'; \
echo 'xdebug.remote_connect_back=0'; \
echo 'xdebug.remote_host='${REMOTE_HOST}; \
} >> /usr/local/etc/php/php.ini
...
As you can see, I’m inciting xdebug.remote_host
with the test value 'abcd'.
I lift the container with the following command docker run -e "REMOTE_HOST=123456" ...
After the container is working, I check the content of php.ini that’s what I have:
[xdebug]
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.idekey=dockerdebug
xdebug.profiler_output_dir="/var/www/html"
xdebug.remote_connect_back=0
xdebug.remote_host=abcd
That is, Xdebug.remote_host is being initialized with the value abcd past dockerfile, but cannot overwrite with value 123456 in the container survey process according to what is suggested in the documentation Overriding Dockerfile image defaults and Additionally, the Operator can set any Environment variable in the container by using one or more -e flags.