Add Dockerfile

This file may be used to build rally image for docker.
More about docker: https://www.docker.com/

Also added some docs in installation.rst

Change-Id: I8580755b6838a3cebc2bd9e27854e68a02ff26b4
This commit is contained in:
Sergey Skripnick 2014-11-03 14:58:43 +02:00
parent 6db0bde36a
commit 705ee34799
2 changed files with 68 additions and 0 deletions

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM ubuntu:14.04
MAINTAINER Sergey Skripnick <sskripnick@mirantis.com>
COPY . /tmp/rally
RUN apt-get update && \
apt-get -y install git python2.7 bash-completion python-dev libffi-dev \
libxml2-dev libxslt1-dev libssl-dev &&\
cd /tmp/rally &&\
./install_rally.sh &&\
apt-get -y remove libssl-dev libffi-dev python-dev libxml2-dev \
libxslt1-dev build-essential gcc-4.8 python3 && \
apt-get -y autoremove &&\
apt-get clean &&\
mv doc /usr/share/doc/rally &&\
rm -fr /tmp/* &&\
rm -rf /var/lib/apt/lists/* &&\
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10 &&\
useradd -m rally &&\
ln -s /usr/share/doc/rally /home/rally/rally-docs
USER rally
CMD bash --login
ENV HOME /home/rally
WORKDIR /home/rally

View File

@ -155,6 +155,52 @@ After the installation step has been completed, you need to create the Rally dat
And finally you are able to :ref:`use Rally <usage>`!
Rally & Docker
^^^^^^^^^^^^^^
There is an image on dokerhub with rally installed. To pull this image just execute:
.. code-block: none
docker pull rallyforge/rally
Or you may want to build rally image from source:
.. code-block: none
# first cd to rally source root dir
docker build -t myrally .
Since rally stores local settings in user's home dir and the database in /var/lib/rally/database,
you may want to keep this directories outside of container. This may be done by the following steps:
.. code-block: none
cd ~ #go to your home directory
mkdir rally_home rally_db
docker run -t -i -v ~/rally_home:/home/rally -v ~/rally_db:/var/lib/rally/database rallyforge/rally
You may want to save last command as an alias:
.. code-block: none
echo 'alias dock_rally="docker run -t -i -v ~/rally_home:/home/rally -v ~/rally_db:/var/lib/rally/database rallyforge/rally"' >> ~.bashrc
After executing ``dock_rally`` alias, or ``docker run`` you got bash running inside container with
rally installed. You may do anytnig with rally, but you need to create db first:
.. code-block: none
user@box:~/rally$ dock_rally
rally@1cc98e0b5941:~$ rally-manage db recreate
rally@1cc98e0b5941:~$ rally deployment list
There are no deployments. To create a new deployment, use:
rally deployment create
rally@1cc98e0b5941:~$
More about docker: `https://www.docker.com/ <https://www.docker.com/>`_
Running Rally's Unit Tests
--------------------------