Skip to content

The dockerfile and doc for building the Docker image JobeInABox

License

Notifications You must be signed in to change notification settings

trampgeek/jobeinabox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JobeInABox

Docker Stars Docker Pulls Docker Automated Docker Build

The Moodle CodeRunner question type plugin requires a Jobe server on which to run student-submitted jobs. JobeInABox is a container image that provides a basic Jobe server that runs all the standard languages but does not have a mysql server installed so cannot use API-key access. For normal use, that's not a problem - API-key access is relevant only to Jobe servers delivering services to multiple clients.

Building and running your own image locally (strongly recommended)

There are several ways to build and run a JobeInABox container, for example:

For production use you should build your own image, configured with an unguessable password and the local timezone. In this example we use Docker as follows:

Pull this repo from Github, cd into the jobeinabox directory and type a command of the form

sudo docker build . -t my/jobeinabox --build-arg TZ="Europe/Amsterdam" --build-arg ROOTPASS="complicated_password"

You can then run your newly-built image with the command

sudo docker run -d -p 4000:80 --name jobe my/jobeinabox

This will give you a jobe server running on port 4000, which can then be tested locally and used by Moodle as explained in the section "Using jobeinabox" below.

Using the pre-built jobeinabox image on docker hub

To run the pre-built Docker Hub image, just enter the command:

sudo docker run -d -p 4000:80 --name jobe trampgeek/jobeinabox:latest

This will give you a jobe server running on port 4000, which can then be tested locally and used by Moodle as explained in the section "Using jobeinabox" below.

Warnings:

  1. The pre-built image has a publicly-visible root password. Use it only for in-house or testing purposes. For production use you should build your own image with a different password and timezone, as in the next section.

  2. The image is over 1 GB, so may take a long time to start the first time, depending on your download bandwidth.

Using jobeinabox

Having started a jobeinabox container by either of the above methods, you can check it's running OK by browsing to

 http://[host_running_docker]:4000/jobe/index.php/restapi/languages

and you should get a JSON-encoded list of the supported languages, namely

[["c","7.3.0"],["cpp","7.3.0"],["java","10.0.2"],["nodejs","8.10.0"],["octave","4.2.2"],["pascal","3.0.4"],["php","7.2.7"],["python3","3.6.5"]]

If you wish to run the test suite within the container, use the command

sudo docker exec -t jobe /usr/bin/python3 /var/www/html/jobe/testsubmit.py

To set your Moodle/CodeRunner plugin to use this dockerised Jobe server, set the Jobe server field in the CodeRunner admin settings (Site Administration > Plugins > Question types > CodeRunner) to

[host_running_docker]:4000

Do not put http:// at the start.

To stop the running server, enter the command:

sudo docker stop jobe

To remove the running server, enter the command:

sudo docker rm jobe

To check if there is anything left, enter the command

sudo docker ps -a

Notes on security:

  1. Note that while the container in which this Jobe runs should be secure, the container's network is currently just bridged across to the host's network. This means that Jobe can be accessed from anywhere that can access the host and can access any URI that the host can access. Firewalling of the host is essential for production use.

  2. Rebuild the container regularly to ensures that it is running with the latest jobe version and security updates.

About

The dockerfile and doc for building the Docker image JobeInABox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published