quark/Dockerfile
Brian Stajkowski ba31915a50 Docker Development
Adding docker integration for easy development of quark.  This
will be closely tied to the current software revision on any
given patch.  This allows you to vagrant up any current code
revision as it will copy over the current working codebase to the
docker image for installation into a virtualenv.

This also employs several docker containers to make it easier to
manage.  It contains Redis, RabbitMQ, MySQL, PHPMySQLAdmin,
and Kabana with Elasticsearch for log analysis.

If your code changes and you need to test again after you
docker_up.sh, you can easily docker_reload.sh and it will
only update quark and start the process.  In addition,
this will insert a set number of networks and subnets for
easy starting.

Change-Id: I70d0ec9aed1548796bd8d4a9c1a94506234378f9
JIRA:NCP-1692
Implements: blueprint vagrant-quark
2016-06-27 22:34:32 -07:00

56 lines
2.8 KiB
Docker

FROM ubuntu:14.04
# General Installation
RUN apt-get update && apt-get install -y python-pip python-dev git wget libmysqlclient-dev build-essential libssl-dev libffi-dev python-dev rsyslog mysql-client
RUN pip install virtualenv
# Configure Rsyslog and Provision DB
RUN echo 'local0.* @@docker-kibana:514' > /etc/rsyslog.d/60-neutron.conf
RUN echo "service rsyslog restart" > ~/entrypoint.sh
RUN echo 'mysql -h docker-mysql -u root -ppassword -e "CREATE DATABASE neutron"' >> ~/entrypoint.sh
# Update setuptools
RUN wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
# Make our directories
RUN mkdir /opt/configs /opt/neutron /opt/quark /opt/venv /opt/wafflehaus /opt/wafflehaus.neutron /var/log/neutron
RUN cd /opt/venv && virtualenv . --distribute
# Clone Neutron & Wafflehaus
RUN git clone https://github.com/openstack/neutron /opt/neutron
RUN git clone https://github.com/roaet/wafflehaus.git /opt/wafflehaus
RUN git clone https://github.com/roaet/wafflehaus.neutron /opt/wafflehaus.neutron
# Pull Neutron and Install
RUN echo "cd /opt/neutron && git pull" >> ~/entrypoint.sh
RUN echo "source /opt/venv/bin/activate && pip install -U -r /opt/neutron/requirements.txt" >> ~/entrypoint.sh
RUN echo "cd /opt/neutron && source /opt/venv/bin/activate && python setup.py develop" >> ~/entrypoint.sh
# Install Quark
RUN echo "source /opt/venv/bin/activate && pip install -U -r /opt/quark/requirements.txt" >> ~/entrypoint.sh
RUN echo "cd /opt/quark && source /opt/venv/bin/activate && python setup.py develop" >> ~/entrypoint.sh
# Install Wafflehaus
RUN echo "cd /opt/wafflehaus && git pull" >> ~/entrypoint.sh
RUN echo "source /opt/venv/bin/activate && pip install -U -r /opt/wafflehaus/requirements.txt" >> ~/entrypoint.sh
RUN echo "cd /opt/wafflehaus && source /opt/venv/bin/activate && python setup.py develop" >> ~/entrypoint.sh
# Install Wafflehaus.Neutron
RUN echo "cd /opt/wafflehaus.neutron && git pull" >> ~/entrypoint.sh
RUN echo "source /opt/venv/bin/activate && pip install -U -r /opt/wafflehaus.neutron/requirements.txt" >> ~/entrypoint.sh
RUN echo "cd /opt/wafflehaus.neutron && source /opt/venv/bin/activate && python setup.py develop" >> ~/entrypoint.sh
# Put configuration files in place and start Neutron
RUN echo "cp /opt/quark/docker.neutron.conf ~/neutron.conf" >> ~/entrypoint.sh
RUN echo "cp /opt/quark/docker.apipaste.ini ~/api-paste.ini" >> ~/entrypoint.sh
RUN echo "cp /opt/quark/docker.policy.json ~/policy.json" >> ~/entrypoint.sh
RUN echo "cp /opt/configs/* ~/" >> ~/entrypoint.sh
RUN echo "source /opt/venv/bin/activate && quark-db-manage --config-file ~/neutron.conf upgrade head" >> ~/entrypoint.sh
RUN echo "source /opt/venv/bin/activate && neutron-server --config-file ~/neutron.conf" >> ~/entrypoint.sh
RUN chmod +x ~/entrypoint.sh
EXPOSE 9696
ENTRYPOINT ["/bin/bash", "-c", "~/entrypoint.sh"]