rally-openstack/Dockerfile
Antonio Messina a9f2cbefc5 Improve installation script
This is an almost complete rewrite of the installation script, mainly
directed to allow installation of Rally also from unprivileged users,
but also adding a few more options and checks.

More in details, the script now:

* can run as unprivileged user.
* support different database types
* allow to specify custom python binary
* always asks confirmation before doing potentially dangerous actions
  (removing directories or installing software)
* automatically install needed software if run as root
* this script is self-sufficient: it automatically downloads Rally
  from the git if needed
* if interrupted, cleans up the virtualenv and/or the downloaded repository

Co-Authored-By: Antonio Messina <antonio.s.messina@gmail.com>
Co-Authored-By: Sergey Skripnick <sskripnick@mirantis.com>
Change-Id: I574d4fd7cc7c8e71720a6a5ff8db22ee4fd4fc81
Closes-bug: #1393887
2015-05-13 18:24:05 +03:00

28 lines
1.1 KiB
Docker

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 libpq-dev wget \
build-essential &&\
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O /tmp/pip.py &&\
python /tmp/pip.py && rm /tmp/pip.py &&\
cd /tmp/rally &&\
./install_rally.sh &&\
pip install -r optional-requirements.txt &&\
sed 's|#*connection *=.*|connection = sqlite:////home/rally/.rally.sqlite|' -i /etc/rally/rally.conf &&\
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 -u 65500 -m rally &&\
ln -s /usr/share/doc/rally /home/rally/rally-docs
USER rally
CMD bash --login
ENV HOME /home/rally
WORKDIR /home/rally