Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Moodle App Docker Images: Difference between revisions

From MoodleDocs
m (Noeldemartin moved page Moodle App Docker images to Moodle App Docker Images: Consistency)
(Update after 3.9.5 release)
Line 1: Line 1:
== Setting up the environment using Docker ==
[https://moodle.com/ Moodle HQ] provides a couple of Docker images that contain the Moodle App ready for use. You can search all the available versions in [https://hub.docker.com/r/moodlehq/moodleapp/tags Docker Hub].


(For this to work, you must have a Docker installation and know roughly how to use it.)
In order to run them, you should have [https://www.docker.com/ Docker] installed and we recommend that you have some basic understanding on how it works.


You can run the app using a Docker image provided by Moodle HQ, with commands like these:
== Running the images ==


== Specific version ==
You can run the latest stable version of the application using the following command:


You can run an specific version of the app using the version number as a tag. Only avalaible from 3.6.0 onwards.
<syntaxhighlight lang="bash">docker run --rm -p 8100:80 moodlehq/moodleapp</syntaxhighlight>


Example:
This will launch the container running the application and expose it locally on your port 8100. You should be able to open it on http://localhost:8100.


<syntaxhighlight lang="php">docker run --rm -p 8100:8100 moodlehq/moodleapp:3.6.0</syntaxhighlight>
If you want to use a specific version, you can do it using the tag with the release number:


== Latest stable version ==
<syntaxhighlight lang="bash">docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5</syntaxhighlight>


This is the stable version that you will find in the stores.
You can also use the development version using the <code>next</code> tag:


<syntaxhighlight lang="php">docker run --rm -p 8100:8100 moodlehq/moodleapp:latest</syntaxhighlight>
<syntaxhighlight lang="bash">docker run --rm -p 8100:80 moodlehq/moodleapp:next</syntaxhighlight>


Specific version and latest stable images are created via Docker integration with GitHub every time a new version of the Moodle app is tagged.
== Using a specific environment ==


== Nightly build of the next release ==
By default, the application will be launched on a ''production'' environment. If you only want to use the application, that will suffice. But if you are trying to debug or run some tests it may not work.


This is the development version that is not stable and is constantly updated. Due to ionic5 migration this is currently equivalent to the latest version.
You can use images on different environments by adding their short name as a suffix. The available environments are ''production'' (no suffix), ''development'' (<code>-dev</code> suffix) and ''testing'' (<code>-test</code> suffix):


<syntaxhighlight lang="php">docker run --rm -p 8100:8100 moodlehq/moodleapp:next</syntaxhighlight>
<syntaxhighlight lang="bash">
# Using the latest stable version
docker run --rm -p 8100:80 moodlehq/moodleapp:latest-test
docker run --rm -p 8100:80 moodlehq/moodleapp:latest-dev


Nightly build images are created via Jenkins every time something new is integrated into the "integration" branch of the [http://github.com/moodlehq/moodleapp/ moodleapp GitHub repository].
# Using a specific version
docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5-test
docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5-dev


=== Ionic 5 experimental version ===
# Using the latest development version
docker run --rm -p 8100:80 moodlehq/moodleapp:next-test
docker run --rm -p 8100:80 moodlehq/moodleapp:next-dev
</syntaxhighlight>


We are currently working on migrating our code to Ionic5. We've created a new temporary tags while developing.
== Using old versions ==


<syntaxhighlight lang="php">docker run --rm -p 8100:80 moodlehq/moodleapp:ionic5</syntaxhighlight>
Before version 3.9.5, images didn't support specifying the environment and they were always run as ''development''. You will also notice that they take a while to launch and they are exposed in port 8100 instead, that's because these images contained the source code and they were run using Angular's development server. This has been improved since and images are easier to work with.


And another one for behat testing:
If you want to use an old version, you can run the following command:


<syntaxhighlight lang="php">docker run --rm -p 8100:80 moodlehq/moodleapp:ionic5-test</syntaxhighlight>
<syntaxhighlight lang="bash">docker run --rm -p 8100:8100 moodlehq/moodleapp:3.6.0</syntaxhighlight>


Note that the port binding is now using port 80, this is because now it uses an standard http server instead of nodeJS. This is a quicker image.
Tagged releases are only available from version 3.6.0 onwards.
 
Both will be renamed or deleted when Ionic5 version is stable.


[[Category:Mobile]][[Category:Docker]]
[[Category:Mobile]][[Category:Docker]]

Revision as of 11:05, 31 August 2021

Moodle HQ provides a couple of Docker images that contain the Moodle App ready for use. You can search all the available versions in Docker Hub.

In order to run them, you should have Docker installed and we recommend that you have some basic understanding on how it works.

Running the images

You can run the latest stable version of the application using the following command:

docker run --rm -p 8100:80 moodlehq/moodleapp

This will launch the container running the application and expose it locally on your port 8100. You should be able to open it on http://localhost:8100.

If you want to use a specific version, you can do it using the tag with the release number:

docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5

You can also use the development version using the next tag:

docker run --rm -p 8100:80 moodlehq/moodleapp:next

Using a specific environment

By default, the application will be launched on a production environment. If you only want to use the application, that will suffice. But if you are trying to debug or run some tests it may not work.

You can use images on different environments by adding their short name as a suffix. The available environments are production (no suffix), development (-dev suffix) and testing (-test suffix):

# Using the latest stable version
docker run --rm -p 8100:80 moodlehq/moodleapp:latest-test
docker run --rm -p 8100:80 moodlehq/moodleapp:latest-dev

# Using a specific version
docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5-test
docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5-dev

# Using the latest development version
docker run --rm -p 8100:80 moodlehq/moodleapp:next-test
docker run --rm -p 8100:80 moodlehq/moodleapp:next-dev

Using old versions

Before version 3.9.5, images didn't support specifying the environment and they were always run as development. You will also notice that they take a while to launch and they are exposed in port 8100 instead, that's because these images contained the source code and they were run using Angular's development server. This has been improved since and images are easier to work with.

If you want to use an old version, you can run the following command:

docker run --rm -p 8100:8100 moodlehq/moodleapp:3.6.0

Tagged releases are only available from version 3.6.0 onwards.