LAMP

LAMP (Linux Apache MySQL PHP) Dockerfile ready to load the PHP custom configuration.

Installation

Build own image

Go to where you copied the Dockerfile:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
$ cd /path/to/my/lamp/dockerfile
$ [sudo] docker build -t my-lamp-app .

Sending build context to Docker daemon  19.97kB
Step 1/7 : FROM tutum/lamp:latest
 ---> 3d49e175ec00
Step 2/7 : LABEL atom="LAMP"
(...)

Successfully built 370ace57d813
Successfully tagged my-lamp-app:latest

Running the image

Running it then should be as simple as:

1
2
3
$ [sudo] docker run -d -p 8080:80 -p 3306:3306 -v /my/awesome/php/app:/app my-lamp-app

95c3b40b59... (docker_id_number)

Parameters:

1
2
3
/my/awesome/php/app: path in the host to the php application. The PHP server will look for "index.php".

/app : path in the docker where the php server will look for the php application.

Examples

1
docker run -d -p 8080:80 -p 3306:3306 -v /home/juan/Workspace/plugin-repos/web-portal:/app my-lamp-app

Original author

Juan GASCON, Orange

Release notes

  • Version 1.0.0

This docker serves a LAMP suite to open php applications in a web browser. The internal servers listen to ports 80 and 3306

PHP server reads what is in the docker "/app" directory. So either you copy the whole application code in that directory or you bind, with the "-v" docker option, the /app docker directory to the directory where you develop/store the application (index.php).