This image is intended for PHP+MySQL development. For convenience, it also runs SSH server to connect to. Both MySQL and phpmyadmin use default XAMPP password.
This image uses /www directory for your page files, so you need to mount it.
docker run -p 8092:22 -p 8090:80 -d -v ~/your_web_pages:/www --name zamp agitoktay/xampp
The command above will expose the SSH server on port 41061 and HTTP server on port 41062.
Feel free to use your own name for the container...
To open to your web app, go to this URL: http://localhost:8090/www
XAMPP interface: http://localhost:8092/
default SSH password is 'root'.
ssh root@localhost -p 8092
docker exec -ti zamp bash
Inside docker container:
export PATH=/opt/lampp/bin:$PATH
You can then use mysql
and friends installed in /opt/lampp/bin
in your current bash session. If you want this to persist, you need to add it to your user or system-wide .bashrc
(inside container).
In your home directory, create a my_apache_conf
directory in which you place any number of apache configuration directive files. As soon as they end up with the .conf extension, they will be used by the image.
docker run --name zamp -p 8092:22 -p 8090:80 -d -v ~/your_web_pages:/www -v ~/my_apache_conf:/opt/lampp/apache2/conf.d agitoktay/xampp
Once you have modified configuration for example
docker exec myXampp /opt/lampp/lampp restart