> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/docker-cong-an-zhuang-dao-ying-yong-ru-men-pian/kuai-su-jia-she-lamp-huan-jing.md).

# 快速架設LAMP環境

{% embed url="<https://hub.docker.com/r/mattrayner/lamp/#persisting-your-mysql>" %}

## 測試:

docker run -p "80:80" -itd mattrayner/lamp:latest-1804

![](https://529150212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lh81JtaIQ84bwQqz_Wh%2F-LkMoY7imrS4m9AWnMuo%2F-LkMoZcCzdgGm8Gz2Ith%2Fimage.png?alt=media\&token=5ec4f532-54fc-4df1-b72d-6bc02180614b)

![](https://529150212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lh81JtaIQ84bwQqz_Wh%2F-LkMoY7imrS4m9AWnMuo%2F-LkMofbSQgR5jqAVmtmu%2Fimage.png?alt=media\&token=14fd4a07-6764-4b97-aae7-d8ff298b0e4c)

## 上線服務

sudo docker run -p "80:80" --name lamp -v /lamp/www:/var/www -v /lamp/mysql:/var/lib/mysql -v /lamp/app\:/app -itd mattrayner/lamp:latest-1804

```
root@853fb59e2bb7:~# cd /var/www
root@853fb59e2bb7:/var/www# mkdir html
root@853fb59e2bb7:/var/www# cd html
root@853fb59e2bb7:/var/www/html# echo '<?php phpinfo();?>' > index.php
```
