blob: 9000b6b9e3b4ef2f1d036de1183538ad95a45efa [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
Andy Baviercabca602015-02-11 17:07:36 -050060# Install custom Ansible
61RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto
62RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml
63RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client
64RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko
65RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2
66RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2
67RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
68RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
69RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
70RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
71RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
Andy Bavier37044342015-02-06 16:39:06 -050072ADD ansible-hosts /etc/ansible/hosts
73
74ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
75
Andy Bavierea979652015-02-10 14:01:07 -050076# For Observer
77RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
78RUN cd /tmp/fofum; python setup.py install
79
S.Çağlar Onurd30d6352015-02-12 11:55:19 -050080RUN mkdir -p /usr/local/share /bin
81ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
S.Çağlar Onurafb88a52015-02-12 12:02:10 -050082RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
S.Çağlar Onurd30d6352015-02-12 11:55:19 -050083RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
84RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
85RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
86
Andy Bavier37044342015-02-06 16:39:06 -050087# Get XOS
88ADD planetstack /opt/xos
89
90ADD observer-initscript /etc/init.d/plstackobserver
91
92RUN chmod +x /opt/xos/scripts/opencloud
93RUN /opt/xos/scripts/opencloud genkeys
94
95# Set postgres password to match default value in settings.py
96RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';"
97
98# Turn DEBUG on so that devel server will serve static files
S.Çağlar Onur29c1f632015-02-12 11:42:20 -050099RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
Andy Bavier37044342015-02-06 16:39:06 -0500100
101# Cruft to workaround problems with migrations, should go away...
Scott Baker6ada9252015-02-18 16:50:48 -0800102RUN /opt/xos/scripts/opencloud remigrate
Andy Bavier37044342015-02-06 16:39:06 -0500103
104EXPOSE 8000
105
106# Set environment variables.
107ENV HOME /root
108
109# Define working directory.
110WORKDIR /root
111
112# Define default command.
113CMD ["/bin/bash"]