These two commands are tools to facilitate the inclusion of PHP modules in Docker, They are part of all official PHP images and so standardize the installation of modules. https://hub.docker.com/_/php/
When installing a PHP module it is necessary to execute a set of procedures that change depending on which module, the PHP version, the web server used and the packages previously installed.
For example, consider the bz2 module in PHP7.2 on Apache2 on Alpine Linux. To activate it, it is necessary that the line "Extension=bz2.so" is in the PHP settings.
When executing the command 'Docker-php-ext-install bz2', a respective file is created in the PHP conf. d folder containing the line for its activation.
That is, it is not enough that the packages are installed for a module to work, PHP still needs small changes in the container that vary according to the image of the selected PHP.
I don’t know about PHP, but it is possible that these guys are utilities that are in the base image of PHP for easy installation and configuration of dependencies.
– Bruno César