How to Install PHP Extensions in your Docker File?
Docker is mainly an open-source platform. It is generally used for containerizing platforms. It is used by developers while implementing a huge project. It helps the developers to implement codes into some containers. It helps to package applications that developers develop into containers. It actually combines the source into the operating system. A Docker file is a file where all commands should be enlisted. These commands are needed for developing purposes. It is used in the command prompt. These commands will combine each other & create graphical images. In this flies some installation can also be done. PHP extensions can be included in this file using the terminal of the file.
- Docker is used widely as it is open-source in nature & light in size.
- Docker is used as it provides high productivity & application isolation process also.
- Docker provides strong security infrastructures, so developers used it most for their projects.
Installing PHP Extensions in Docker File
To Install PHP Extensions in your Docker File follow the following steps:
Step 1: At first, the terminal in the docker file should be opened. The following command should be run. It will enable the bash for writing commands in PHP. It will take some to enable it.
docker run –rm -it php:7.2 bash
Step 2: Then the following command should be used. This command will install all the extensions needed for the certain Docker file. It will take some time. As it is going to first download it and then configure and install it to a certain file.
/usr/local/bin# docker-php-ext-install intl
Step 3: After waiting some time, when the process is completed, one message will show ‘Build complete’. So, all the extensions related to PHP has installed in the Docker file.
Hence, the process is completed successfully.
Please Login to comment...