A Dockerfile that installs and runs the latest Moodle stable.
git clone https://github.com/jda/docker-moodle cd docker-moodle docker build -t moodle .
To spawn a new instance of Moodle:
docker run -d --name DB -p 3306:3306 -e MYSQL_DATABASE=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle centurylink/mysql docker run -d -P --name moodle --link DB:DB -e MOODLE_URL=http://192.168.59.103:8080 -p 8080:80 jauer/moodle
You can visit the following URL in a browser to get started:
The following aren't handled, considered, or need work:
- moodle cronjob (should be called from cron container)
- log handling (stdout?)
- email (does it even send?)
This is a reductionist take on sergiogomez's docker-moodle Dockerfile.
can you install VPL-jailserver wiith that docker image
I saw it pulled from Ubuntu I'm running centos7 will it still work ? guess I will find out.
I've defined a docker-compose.yaml
- 3306:3306 environment: MYSQL_DATABASE: moodle MYSQL_ROOT_PASSWORD: root MYSQL_USER: moodle MYSQL_PASSWORD: moodle
- 8080:80 links: - db:DB environment: MOODLE_URL: http://172.16.0.21:8080
I bring up both the containers with
docker-compose up -d
but when I browse to http://172.16.0.21:8080/, after the first welcome screen, I get redirected to a
Error reading from database It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation.
How should I solve this?
If not interested in sending email, but stop moodle hanging when it tries to send one, just add the following, to moodle-config.php:
$CFG->noemailever = true;
Moodle "hung" when ever it hit a point where email had to be sent.
To fix, get a bash shell into the running container.
postfix check and correct whatever it finds.
/etc/postfix/main.cf, and add the line
setgid_group = postdrop somewhere (I added about mid file).
Restart postfix (I had to manually kill postfix and then start it again).
After that - everything worked like a charm
Thanks! This is what I did to get this running with an already existing mysql container:
docker run -d --name test-moodle --link wp-mysql:DB -e DB_ENV_MYSQL_DATABASE="moodle" -e DB_ENV_MYSQL_USER="moodle" -e DB_ENV_MYSQL_PASSWORD="moodle" -e MOODLE_URL="http://moodle.mariapazu.com" moodle
Of course, that required to have the moodle user, database & permissions created on the mysql container (I'm using the official mysql container)
Thanks for putting this image together. Very helpful!!
Here are my steps to get a persistent mysql data setup and link moodle container to the mysql DB
docker run -i -t --name mysql_data -v /var/lib/mysql busybox
docker run --name mysql -d -p 3306:3306 --volumes-from mysql_data -e MYSQL_DATABASE=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle centurylink/mysql
docker run -d -P --name moodle --link mysql:DB -e MOODLE_URL=http://192.168.59.103:8080 -p 8080:80 jauer/moodle