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 (Text replacement - "<code>" to "<syntaxhighlight lang="php">")
(Update migration status and path)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Setting up the environment using Docker ==
{{Template:Migrated|newDocId=/general/app/development/setup/docker-images}}
{{Moodle App (Ionic 5)}}


(For this to work, you must have a Docker installation and know roughly how to use it.)
[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].


You can run the app using a Docker image provided by Moodle HQ, with commands like these:
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.


== Specific version ==
== Running the images ==


You can run an specific version of the app using the version number as a tag. Only avalaible from 3.6.0 onwards.
You can run the latest stable version of the application using the following command:


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


<syntaxhighlight lang="php">docker run --rm -p 8100:8100 moodlehq/moodleapp:3.6.0</syntaxhighlight>
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.


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


This is the stable version that you will find in the stores.
<syntaxhighlight lang="bash">docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5</syntaxhighlight>


<syntaxhighlight lang="php">docker run --rm -p 8100:8100 moodlehq/moodleapp:latest</syntaxhighlight>
You can also use the development version using the <code>next</code> tag:


Specific version and latest stable images are created via Docker integration with GitHub every time a new version of the Moodle app is tagged.
<syntaxhighlight lang="bash">docker run --rm -p 8100:80 moodlehq/moodleapp:next</syntaxhighlight>


== Nightly build of the next release ==
== Using a specific environment ==


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.
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.


<syntaxhighlight lang="php">docker run --rm -p 8100:8100 moodlehq/moodleapp:next</syntaxhighlight>
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):


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].
<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


=== Ionic 5 experimental version ===
# 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


We are currently working on migrating our code to Ionic5. We've created a new temporary tags while developing.
# 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>


<syntaxhighlight lang="php">docker run --rm -p 8100:80 moodlehq/moodleapp:ionic5</syntaxhighlight>
== Using old versions ==


And another one for behat testing:
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.


<syntaxhighlight lang="php">docker run --rm -p 8100:80 moodlehq/moodleapp:ionic5-test</syntaxhighlight>
If you want to use an old version, you can run the following command:


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.
<syntaxhighlight lang="bash">docker run --rm -p 8100:8100 moodlehq/moodleapp:3.6.0</syntaxhighlight>


Both will be renamed or deleted when Ionic5 version is stable.
Tagged releases are only available from version 3.6.0 onwards.


[[Category:Mobile]][[Category:Docker]]
[[Category: Mobile]]
[[Category: Docker]]
[[Category: Moodle App Ionic 5]]

Latest revision as of 13:03, 14 July 2022

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!


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.