How to make the project run when there is only linux system

09-11-2023

First, create the project 

Please click here to exit full screen mode:

Second, write the dockerfile file "dockerfile from PHP: 5.6-Apache Rundocker-PHP-ext-installmysqli add project1/var/www/html".

After editing dockerfile, generate a mirror image. The command is: Docker Build-T Malina _ PHP _ Project.

When you see

It means that the image has been generated successfully.

Third, generate the container to run the mirror "docker run-it-d-name malina _ PHP _ project malina _ PHP _ project"

Check to see if the mirror is active, docker ps.

4. Run the file in the container and enter localhost in the browser. If you find this ghost, you will not report an error or display it. You can see the ip in docker logs (container id)18b429b2ceac.

Enter the visit in the browser again: http:/http://x.x.0.2/phpinfo.php Are you happy or excited when you visit it?

V. What files are added? ADD project1 /var/www/html. copy the project to the container's var/www/html directory. Here, only the contents below project1 will be copied, and project1 itself will not be copied.

Docker exec -it 18b429b2ceac (container id) /bin/bash

VI. Directory Mounting docker run -it -v/Host Directory:/Container Directory Mirror Name: Mirror Label Docker Run-it-d-v/Home/Malina/Project/Project1:/var/www/htmlmalina _ PHP _ project: latest.

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us