Can't change PHP variables in Joomla docker official container
You will have to provide your own php.ini file, and load that to the container as a volume.To do that, add the following flag to the docker run
command:
-v local/path/to/php.ini:/usr/local/etc/php/php.ini
If you are using docker compose, update the volumes section of your joomla container definition to look like this:
joomla_container: ... volumes: ... - local/path/to/php.ini:/usr/local/etc/php/php.ini
You definitely shouldn't try to edit the configuration in a running container. If you do this, you'd lose your changes when you update the instance.