blob: 6ea3239477a6f5e6ad9990566e8caba6f9c919cd [file] [log] [blame]
Andy Bavier37044342015-02-06 16:39:06 -05001FROM ubuntu:14.04.1
2MAINTAINER Andy Bavier <acb@cs.princeton.edu>
3
Tony Mack4faa5f92015-02-10 16:47:12 -05004# 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
8RUN ln -s -f /bin/true /usr/bin/chfn
9# XXX End workaround
10
Andy Bavier37044342015-02-06 16:39:06 -050011# Install.
12RUN apt-get update
Andy Bavier4578ae72015-02-10 16:37:33 -050013RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git
14RUN DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql
15RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-psycopg2
16RUN DEBIAN_FRONTEND=noninteractive apt-get install -y graphviz graphviz-dev
17RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libxslt1.1 libxslt1-dev
18RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip
19RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tar
20RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc
21RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2
22RUN DEBIAN_FRONTEND=noninteractive apt-get install -y geoip-database libgeoip1
23RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget
24RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-dev
25RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libyaml-dev
Andy Bavier37044342015-02-06 16:39:06 -050026
27RUN pip install django==1.7
28RUN pip install djangorestframework==2.4.4
29RUN pip install markdown # Markdown support for the browseable API.
30RUN pip install pyyaml # YAML content-type support.
31RUN pip install django-filter # Filtering support
32RUN pip install lxml # XML manipulation library
33RUN pip install netaddr # IP Addr library
34RUN pip install pytz
35RUN pip install django-timezones
36RUN pip install requests
37RUN pip install django-crispy-forms
38RUN pip install django-geoposition
39RUN pip install django-extensions
40RUN pip install django-suit
41RUN pip install django-evolution
42RUN pip install django-bitfield
43RUN pip install django-ipware
44RUN pip install django-encrypted-fields
45RUN pip install python-keyczar
46
Andy Bavier4578ae72015-02-10 16:37:33 -050047RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient
48RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient
49RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient
50RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient
51RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient
Andy Bavier37044342015-02-06 16:39:06 -050052
53RUN pip install django_rest_swagger
54
Andy Bavier4578ae72015-02-10 16:37:33 -050055RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools
Andy Bavier37044342015-02-06 16:39:06 -050056RUN easy_install django_evolution
57RUN easy_install python_gflags
58RUN easy_install google_api_python_client
59
60# Set up latest Ansible
61# Need to add our patches too
Andy Bavier4578ae72015-02-10 16:37:33 -050062RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ansible
Andy Bavier37044342015-02-06 16:39:06 -050063# RUN git clone --recursive git://github.com/ansible/ansible.git /opt/ansible
64ADD ansible-hosts /etc/ansible/hosts
65
66ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
67
Andy Bavierea979652015-02-10 14:01:07 -050068# For Observer
69RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
70RUN cd /tmp/fofum; python setup.py install
71
Andy Bavier37044342015-02-06 16:39:06 -050072# Get XOS
73ADD planetstack /opt/xos
74
75ADD observer-initscript /etc/init.d/plstackobserver
76
77RUN chmod +x /opt/xos/scripts/opencloud
78RUN /opt/xos/scripts/opencloud genkeys
79
80# Set postgres password to match default value in settings.py
81RUN 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
84RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/planetstack/settings.py
85
86# Cruft to workaround problems with migrations, should go away...
87RUN /opt/xos/scripts/opencloud dropdb
88RUN rm -rf /opt/xos/*/migrations
89RUN cd /opt/xos; python ./manage.py makemigrations core
90RUN cd /opt/xos; python ./manage.py makemigrations hpc
91RUN cd /opt/xos; python ./manage.py makemigrations requestrouter
92RUN cd /opt/xos; python ./manage.py makemigrations syndicate_storage
93RUN cd /opt/xos; python ./manage.py makemigrations servcomp
94
95RUN /opt/xos/scripts/opencloud initdb
96
97EXPOSE 8000
98
99# Set environment variables.
100ENV HOME /root
101
102# Define working directory.
103WORKDIR /root
104
105# Define default command.
106CMD ["/bin/bash"]