| PHP version | Corresponding tag |
|---|---|
| 8.0.3 | rodger753/xampp:8 |
| 7.3.7 | rodger753/xampp:7 |
| 5.6.40 | rodger753/xampp:5 |
For PHP 8, start your container like this:
docker run --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/www tomsik68/xampp:8
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 --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/www rodger753/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 browse to your web page, visit this URL: http://localhost:41062/www And to open up the XAMPP interface: http://localhost:41062/
| service | username | password |
|---|---|---|
| ssh | root | root |
| service | username | password |
|---|---|---|
| mysql | root | none |
/www folderNo problem, just mount your app in the /opt/lampp/htdocs folder, for example:
docker run --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/opt/lampp/htdocs tomsik68/xampp
default SSH password is 'root'.
ssh root@localhost -p 41061
docker exec -ti myXampp bash
In your home directory, create a my_apache_conf directory in which you place any number of apache configuration files. As soon as they end with the .conf extension, they will be used by xampp. Make sure to use the following flag in your command: -v ~/my_apache_conf:/opt/lampp/apache2/conf.d, for example:
docker run --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/www -v ~/my_apache_conf:/opt/lampp/apache2/conf.d tomsik68/xampp
Once you have modified configuration for example
docker exec myXampp /opt/lampp/lampp restart
If you used the flag -p 41062:80 with docker run, just browse to http://localhost:41062/phpmyadmin/ .
Currently, the Docker image is built only for PHP 5, 7 and 8. If you need another version, you can easily build a Docker image yourself, here's how:
docker build --build-arg XAMPP_URL="https://www.apachefriends.org/xampp-files/5.6.40/xampp-linux-x64-5.6.40-1-installer.run?from_af=true" .Credits to tomsik68, since this image was created based on his image: https://github.com/tomsik68/docker-xampp
Content type
Image
Digest
Size
500.9 MB
Last updated
over 5 years ago
docker pull rodger753/docker-xampp:7