Commit b5e7775f authored by Maarten de Waard's avatar Maarten de Waard
Browse files

document what we fixed about the docker edx setup

parent 9d1c057f
Docker -- Creating a working docker setup for Open EdX
Installation and preparing
Install ``docker`` and ``docker-compose`` according to the instructions on the
internet ( You're going to need to download a binary blob from
githubu for docker-compose :(
We'll need the ansible playbooks and docker setup files for edx, these are
accessed by cloning the edx configuration repo: ``git clone``. You can do this anywhere you want, but I
decided to do it from ``/var/tmp``, because that's what most edx playbooks do.
In the rest of this document, I'll assume the directory name ``configuration``
for the folder containing the configuration repo.
Starting docker
We'll be using ``docker-compose`` to setup and link all EdX's separate dockers.
cd to ``configuration/docker/compose/edx``, and you'll find a
``docker-compose.yml`` file there. This is the file that contains all the docker
containers that EdX is going to use.
Run ``docker-compose up`` to start everything. Now normally, when you a have
well working docker setup, this would set everything up and you'll be done after
this step. This, however is not the case, because you will see a couple of
Jun already submitted a pull request for this, but the first thing we see, is
that the _forum_ container has the wrong name. It tries to include edxops/forum,
but if you change the image-name in the ``docker-compose.yml`` file to
edxops/forums it will work.
Missing containers
The next problem you'll encounter is that the containers _nginx_ and _xqueue_ are
missing from the public registry/docker hub. You can build these containers from
the ``configuration`` directory, by running ``make$container``.
run ``make help`` for more information.
For _nginx_, for example, one should run ``make``. After
running this, because the docker images are not made completely according to
standards, we still need to tag the new container. Check the output of make, and
run ``docker tag <container hash> edxops/nginx:v1`` to tag it. To find the
correct tag, you should take a look at the lines for the nginx container in the
``docker-compose.yml`` file.
Broken xqueue
Now, when running ``docker-compose up`` again, _xqueue_ seems to be restarting
constantly. To investigate the issue, we are going to try to read the logs.
Rerun docker-compose, but add the ``-d`` flag so you daemonise the process and
can take a look in the container: ``docker-compose up -d``. Open a terminal in
the container by running the following command:
.. code::bash
docker exec -it xqueue bash
The argument ``-i`` is for interactive, ``-t`` is for tty. Now, you can find and
read the xqueue log. The logs are located in the ``/edx/var/log`` directory.
There's an xqueue directory there, but it's probably empty. Take a look at the
xqueue files in the supervisor directory:
``tail -f /edx/var/log/supervisor/xqueue*``
Now you'll be able to see the problem: the connection with the db container is
failing. By taking a look at the xqueue ansible role variables, you can find
out that the username and password configured in the db container are wrong.
There's also not a 'link' to the db container in the description of xqueue.
Re-install the xqueue after making your config look like this. For db:
.. code::
container_name: db
image: mysql:5.6
- MYSQL_USER=xqueue001
- ${DOCKER_DATA_ROOT}/mysql/data:/var/lib/mysql
- 3306:3306
And for xqueue:
.. code::
container_name: xqueue
image: edxops/xqueue:v1
- 8040:8040
- 18040:18040
- ${DOCKER_EDX_ROOT}/xqueue:/edx/app/edxapp/xqueue
- db:db.xqueue
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment