Public Repository

Last pushed: 2 years ago
Short Description
PHP,MySQL,Apache,Composer,PHPUnit,PHPCS,GitReview,GitSVN,Curl,Wget,Vim
Full Description

Lianghong LAMP

PHP,MySQL,Apache,Composer,PHPUnit,PHPCS,GitReview,GitSVN,Curl,Wget,Vim

Usage

If you have not installed docker you may need to execute the following command

sudo curl -s https://get.docker.io/ubuntu/ | sudo sh

To create the image

docker build -t <yourname>/lamp .

Running your lamp docker image

Start your image binding the external ports 80 and 3306 in all interfaces to your container:

docker run -d -p 80:80 -p 3306:3306 username/my-lamp-app
docker run -i -t -p 80:80 -p 3306:3306 username/my-lamp-app /bin/bash

Test your deployment:

curl http://localhost/

Hello world!

Advanced Usage

#Set mysql admin password
docker run -d -p 80:80 -p 3306:3306 -e MYSQL_PASS="mypass" username/my-lamp-app
docker run -d -p 80:80 -p 3306:3306 -v /path/to/your/app:/app username/my-lamp-app #start your app in docker
docker run -i -t -p 80:80 -p 3306:3306 -v /path/to/your/app:/app -v /path/to/your/.bashrc:/.bashrc username/my-lamp-app /bin/bash
#get an terminal and then use "^C + z" to input your command

by clh021@gmail.com

Appendix

One-time operation

cat ./ubuntu.lamp.2014110416.tar | sudo docker import - deepin_webserver
#Depending on your configuration updates apache_default your local hosts file
sudo docker run -i -t -p 80:80 -p 3306:3306 -v /media/lee/DATA/www:/app -v /media/lee/DATA/www/docker.ubuntu/apache_default:/etc/apache2/sites-available/000-default.conf deepin_webserver /bin/bash

Common Operations

sudo docker start -i $(sudo docker ps -a | grep deepin_webserver:latest | awk '{print $1}')
#sudo docker stop $(sudo docker ps -a | grep deepin_webserver:latest | awk '{print $1}')
#sudo docker export 2104174b736b > /media/lee/DATA/www/test/lianghong.work.ubuntu.2014110611.tar
Docker Pull Command
Owner
leehom