Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 1 | FROM ubuntu:14.04.1 |
| 2 | MAINTAINER Andy Bavier <acb@cs.princeton.edu> |
| 3 | |
Tony Mack | 4faa5f9 | 2015-02-10 16:47:12 -0500 | [diff] [blame^] | 4 | # XXX Workaround for docker bug: |
| 5 | # https://github.com/docker/docker/issues/6345 |
| 6 | # Kernel 3.15 breaks docker, uss the line below as a workaround |
| 7 | # until there is a fix |
| 8 | RUN ln -s -f /bin/true /usr/bin/chfn |
| 9 | # XXX End workaround |
| 10 | |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 11 | # Install. |
| 12 | RUN apt-get update |
Andy Bavier | 4578ae7 | 2015-02-10 16:37:33 -0500 | [diff] [blame] | 13 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git |
| 14 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql |
| 15 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-psycopg2 |
| 16 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y graphviz graphviz-dev |
| 17 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libxslt1.1 libxslt1-dev |
| 18 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip |
| 19 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tar |
| 20 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc |
| 21 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2 |
| 22 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y geoip-database libgeoip1 |
| 23 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget |
| 24 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-dev |
| 25 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libyaml-dev |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 26 | |
| 27 | RUN pip install django==1.7 |
| 28 | RUN pip install djangorestframework==2.4.4 |
| 29 | RUN pip install markdown # Markdown support for the browseable API. |
| 30 | RUN pip install pyyaml # YAML content-type support. |
| 31 | RUN pip install django-filter # Filtering support |
| 32 | RUN pip install lxml # XML manipulation library |
| 33 | RUN pip install netaddr # IP Addr library |
| 34 | RUN pip install pytz |
| 35 | RUN pip install django-timezones |
| 36 | RUN pip install requests |
| 37 | RUN pip install django-crispy-forms |
| 38 | RUN pip install django-geoposition |
| 39 | RUN pip install django-extensions |
| 40 | RUN pip install django-suit |
| 41 | RUN pip install django-evolution |
| 42 | RUN pip install django-bitfield |
| 43 | RUN pip install django-ipware |
| 44 | RUN pip install django-encrypted-fields |
| 45 | RUN pip install python-keyczar |
| 46 | |
Andy Bavier | 4578ae7 | 2015-02-10 16:37:33 -0500 | [diff] [blame] | 47 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient |
| 48 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient |
| 49 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient |
| 50 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient |
| 51 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 52 | |
| 53 | RUN pip install django_rest_swagger |
| 54 | |
Andy Bavier | 4578ae7 | 2015-02-10 16:37:33 -0500 | [diff] [blame] | 55 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 56 | RUN easy_install django_evolution |
| 57 | RUN easy_install python_gflags |
| 58 | RUN easy_install google_api_python_client |
| 59 | |
| 60 | # Set up latest Ansible |
| 61 | # Need to add our patches too |
Andy Bavier | 4578ae7 | 2015-02-10 16:37:33 -0500 | [diff] [blame] | 62 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ansible |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 63 | # RUN git clone --recursive git://github.com/ansible/ansible.git /opt/ansible |
| 64 | ADD ansible-hosts /etc/ansible/hosts |
| 65 | |
| 66 | ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/ |
| 67 | |
Andy Bavier | ea97965 | 2015-02-10 14:01:07 -0500 | [diff] [blame] | 68 | # For Observer |
| 69 | RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum |
| 70 | RUN cd /tmp/fofum; python setup.py install |
| 71 | |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 72 | # Get XOS |
| 73 | ADD planetstack /opt/xos |
| 74 | |
| 75 | ADD observer-initscript /etc/init.d/plstackobserver |
| 76 | |
| 77 | RUN chmod +x /opt/xos/scripts/opencloud |
| 78 | RUN /opt/xos/scripts/opencloud genkeys |
| 79 | |
| 80 | # Set postgres password to match default value in settings.py |
| 81 | RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';" |
| 82 | |
| 83 | # Turn DEBUG on so that devel server will serve static files |
| 84 | RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/planetstack/settings.py |
| 85 | |
| 86 | # Cruft to workaround problems with migrations, should go away... |
| 87 | RUN /opt/xos/scripts/opencloud dropdb |
| 88 | RUN rm -rf /opt/xos/*/migrations |
| 89 | RUN cd /opt/xos; python ./manage.py makemigrations core |
| 90 | RUN cd /opt/xos; python ./manage.py makemigrations hpc |
| 91 | RUN cd /opt/xos; python ./manage.py makemigrations requestrouter |
| 92 | RUN cd /opt/xos; python ./manage.py makemigrations syndicate_storage |
| 93 | RUN cd /opt/xos; python ./manage.py makemigrations servcomp |
| 94 | |
| 95 | RUN /opt/xos/scripts/opencloud initdb |
| 96 | |
| 97 | EXPOSE 8000 |
| 98 | |
| 99 | # Set environment variables. |
| 100 | ENV HOME /root |
| 101 | |
| 102 | # Define working directory. |
| 103 | WORKDIR /root |
| 104 | |
| 105 | # Define default command. |
| 106 | CMD ["/bin/bash"] |