Dockerfile Cookbook Recipes Attempt 1: moodle (failure)
In this guide we go over the first attempt at rolling your own moodle container.
- Moodle is considered the defacto educational test taking / building system.
We will attempt the most basic build and from that look at security basics.
Step 1: Make a moodle install point
- Make a directory /moodle
- Inside it we will build a moodle source point.
mkdir moodle
cd moodle
git clone https://github.com/moodle/moodle.git
chown -R www-data:root moodle
Step 2: Running a moodle instance (diagnostic testing)
- Is built off of calling a php image and giving it a -v point that matches where moodle is installed, thus:
docker run -it -v /moodle/moodle:/var/www/html -p 8080:80 --name moodle php:apache
It will show up as:
http://<external ip>:8080/install.php
A basic install serial:
The installer is pretty comprehensive (and forgiving) it will guide you if you need to change a permission.
- Moodle is used to having it's own server, but we have containerized it using the -v option to map its directory to the moodle directory
To fix this we need to get into the running container itself
chown -R www-data:root www
It supports the following drivers:
- We can see at this point we need to go back and build a modified Dockerfile - which has the PDO / database objects as it was not native to the container.