Just run the following code on your Command Line terminal
docker run -d --name php -e PUBLIC_DIR=public -p 8082:80 -v /Users/venus/Downloads/VJAdmin-master:/var/www --link mysql:dockermysql lxqx/apache2-php73
该命令演示了所有的参数选项
The command above shows all available options
PUBLIC_DIR
该目录下的所有的php文件均可被访问到,默认是public,即目录层级是:/var/www/public,如果你将/var/www映射到了你自己的本地目录,那么请确保你自己的本地目录有public目录,当然,该目录名称就是通过PUBLIC_DIR指定的All php files of the directory where pointed by PUBLIC_DIR can be accessed. The default value of PUBLIC_DIR is public, that is such that dir hierarchy like /var/www/public. If you wanna map /var/www to local dir of your own machine, please ensure the dir mapped on your file system includes a dir named public ( Of course the value of PUBLIC_DIR ).
一种不推荐的做法就是你直接可以将/var/www/public目录映射到你本地的任意目录,然后该目录中的php文件即可被访问
A not recommended way as a alternative you can use is that you can map /var/www/public to your arbitrary dirs on your file system directly in which php files can be accessed.
容器没有提供mysql安装,因为MySQL完全可以使用另外一个容器
This container doesn't involve mysql, so you can use another container as a mysql. Likewise you can run the following code in your terminal.
mysql 容器执行命令
The command to create mysql container
docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=12345678 -p 3306:3306 mysql
Content type
Image
Digest
Size
116.8 MB
Last updated
about 7 years ago
docker pull lxqx/apache2-php73