This docker contain a LAMP stack installed from scratch
docker run -d -v /path/to/project:/var/www/localhost/htdocs/ -v /path/to/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -p 80:80 -p 3306:3306 --name lamp j1cs/alpine-lamp
git clone https://github.com/j1cs/alpine-lamp && cd alpine-lamp/
docker build -t $USER/alpine-lamp .
docker run -d -v /path/to/project:/var/www/localhost/htdocs/ -e MYSQL_ROOT_PASSWORD=password -p 80:80 -p 3306:3306 --name lamp $USER/alpine-lamp
To use this you need to install mysql/mariadb cli client
mysql -uroot -ppassword -h 127.0.0.1
If you want to use phpMyAdmin use the branch called: phpmyadmin-feature
sudo chmod -Rf 755 /path/to/project
If you get errors about activating InnoDB and you are on Windows or Mac, you may be encountering this issue with using host-mapped volumes for MariaDB. Work-around is to use a named volume (persistent but not mapped), or add/overwrite mysql config before entry.
Please let me know or create a pull request
https://hub.docker.com/r/j1cs/alpine-lamp
https://github.com/j1cs/alpine-lamp