From 67d9758162f531d6527a3555b5ede3ea619b03c2 Mon Sep 17 00:00:00 2001 From: Ryan Brady Date: Wed, 17 May 2017 12:02:22 -0400 Subject: [PATCH] Update Docker README This patch updates the docker README file to include the --link arg to the command for launching a Mistral container to ensure the rabbitmq and mistral containers can communicate. This patch also adds a new section that explains how and why to mount the Mistral source code as a volume in a running container. Change-Id: Iec25f7e7dfda0bc8c9b38fa37b048448d73f66e4 Co-Authored-By: Brad Crochet --- tools/docker/DOCKER_README.rst | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tools/docker/DOCKER_README.rst b/tools/docker/DOCKER_README.rst index ebd8c97af..9fd2460eb 100644 --- a/tools/docker/DOCKER_README.rst +++ b/tools/docker/DOCKER_README.rst @@ -20,7 +20,6 @@ on this process, check out `the official guide at `_. - Build the Mistral image ----------------------- @@ -36,7 +35,7 @@ Start a RabbitMQ container:: Start Mistral:: - docker run -d -p 8989:8989 --name mistral mistral-all + docker run -d --link rabbitmq:rabbitmq -p 8989:8989 --name mistral mistral-all To execute commands inside the container:: @@ -47,11 +46,40 @@ E.g. to list workflows, issue:: mistral workflow-list +Running Mistral From A Volume +----------------------------- + +A scenario you may find useful for development is to clone a Mistral git repo +and link it into the container via a volume. This will allow you to make changes +to the Mistral source on your local machine and execute them immediately in the +container. + +The following example illustrates launching the container from the local +directory of a git repo clone of Mistral.:: + + docker run -d --link rabbitmq:rabbitmq -v $(pwd):/opt/stack/mistral:Z -p 8989:8989 --name mistral mistral-all + +You might want to mount an additional drive to move files easily between your +development computer and the container. An easy way to do this is to mount an +additional volume that maps to /home/mistral/ in the container. + +Since the directory is already being used to store the mistral.conf and +mistral.sqlite files, you will want to copy these to the local directory you +intend to use for the mount. This example assumes the directory to mount is +"/tmp/mistral". You should change this to the actual directory you intend to +use.:: + + docker cp mistral:/home/mistral/mistral.conf /tmp/mistral/mistral.conf + docker cp mistral:/home/mistral/mistral.sqlite /tmp/mistral/mistral.sqlite + + docker run -d --link rabbitmq:rabbitmq -v $(pwd):/opt/stack/mistral:Z -v /tmp/mistral:/home/mistral:Z -p 8989:8989 --name mistral mistral-all + + Running Mistral with MySQL -------------------------- Other than the simplest use cases will very probably fail with various errors -due to the default Sqlight database. It is highly recommended that, for +due to the default Sqlite database. It is highly recommended that, for example, MySQL is used as database backend. The `start_mistral_rabbit_mysql.sh` script sets up a rabbitmq container, a