Public Repository

Last pushed: 10 months ago
Short Description
Image for Raspberry PI with Apache, PHP5 and MySQL ready to go - the full LAMP stack.
Full Description


This image provides the LAMP stack for the Raspberry PI: an apache2 web server with PHP and MySQL.

The image is based on fastberry/apachephp which in turned uses resin/rpi-raspbian. This is intended for learning, experimenting, prototyping, and to get started quickly without much overhead on simple web services.

The web content can be put anywhere in a directory that is accessible to the Raspberry PI and can be externally modified, backed up, etc.

The MySQL server is configured to not have a root password.

This image is also used as a building block for other fastberry images (search for "fastberry").

How to use

For convenience the commands below use names for the containers. The name is specified using the --name option when starting the container.

Open a terminal and start the container with:

     docker run --name apachephpmysql -it -p 80:80 fastberry/apachephpmysql

The container will start the apache and MySQL services and enter a shell. You should see this:

pi@pishare:~/docker/fastberryApachePHPMySQL $ docker run --name apachephpmysql -it -p 80:80 fastberry/apachephpmysql:latest
Starting services
Starting MYSQL server...
Waiting for MySQL server to start and accept connections...........
Starting Apache
Services should be running

Check for apache
4 S root       411     1  0  80   0 -   456 wait   15:21 ?        00:00:00 /bin/sh /usr/sbin/apache2ctl -D FOREGROUND
0 S root       413    11  0  80   0 -  1070 pipe_w 15:21 ?        00:00:00 grep apache

Check for MySQL
4 S root        13     1  0  80   0 -   456 wait   15:21 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
4 S mysql      364    13  8  80   0 - 81543 -      15:21 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr   .....
0 S root       417    11  0  80   0 -  1070 pipe_w 15:21 ?        00:00:00 grep mysql
MySQL Version: 
mysql  Ver 14.14 Distrib 5.5.54, for debian-linux-gnu (armv7l) using readline 6.3
| user             | host         |
| root             |    |
| root             | 7d8b079f8b95 |
| root             | ::1          |
| debian-sys-maint | localhost    |
| fastberry        | localhost    |
| root             | localhost    |

The shell will remain open for interacting with the container until the container iskilled or you exit the shell.

Connect to the Raspberry PI using your favorite web browser. If all went well you should see a welcome page with two links that let you test the basic PHP and MySQL setup.

To stop the container, open another terminal and type:

     docker -kill apachephpmysql

In order to start serving up your own web content create a directory and put your files there. Then run the docker container again using these commands, giving the name of your directory:

     docker rm apachephpmysql
     docker run --name apachephpmysql -it -p 80:80 -v <name of your directory>:/var/www/html fastberry/apachephpmysql

You can update your web content by editing your files in the web content directory, or copying files from another location.

If you want to make the web server available with a different port number reply the first "80" in the docker run command line with your port number.

Docker Pull Command