blob: dc4c927c7f194c7cff51c7a6b43133912047bef8 [file] [log] [blame]
Tony Mack2d7c7ff2015-10-27 16:57:17 -04001FROM ubuntu:14.04.3
2MAINTAINER Andy Bavier <acb@cs.princeton.edu>
3
4# Set environment variables.
5ENV HOME /root
6
7# XXX Workaround for docker bug:
8# https://github.com/docker/docker/issues/6345
9# Kernel 3.15 breaks docker, uss the line below as a workaround
10# until there is a fix
11RUN ln -s -f /bin/true /usr/bin/chfn
12# XXX End workaround
13
14# Install.
15RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
16 curl \
17 git \
18 geoip-database \
19 graphviz \
20 graphviz-dev \
21 libgeoip1 \
22 libxslt1.1 \
23 libxslt1-dev \
24 libyaml-dev \
25 m4 \
26 nginx \
27 openssh-client \
28 python-dev \
29 pkg-config \
30 postgresql \
31 python-crypto \
32 python-httplib2>=0.9.1 \
33 python-jinja2 \
34 python-paramiko \
35 python-pip \
36 python-psycopg2 \
37 python-pycurl \
38 python-setuptools \
39 python-yaml \
40 python-keystoneclient \
41 python-novaclient \
42 python-neutronclient \
43 python-glanceclient \
44 python-ceilometerclient \
45 supervisor \
46 tar \
47 wget
48
49RUN pip install \
50 django==1.7 \
51 djangorestframework==2.4.4 \
52 markdown \
53 pyyaml \
54 django-filter \
55 lxml \
56 netaddr \
57 pytz \
58 django-timezones \
59 requests \
60 django-crispy-forms \
61 django-geoposition \
62 django-extensions \
63 django-suit \
64 django-bitfield \
65 django-ipware \
66 django-encrypted-fields \
67 django_rest_swagger \
68 python-dateutil \
69 python-keyczar \
70 pygraphviz \
71 dnslib \
72 uwsgi
73
74RUN easy_install --upgrade httplib2
75
76RUN easy_install \
77 django_evolution \
78 python_gflags \
79 google_api_python_client \
80 httplib2.ca_certs_locater
81
82
83# Install custom Ansible
84RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
85RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
86RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
87RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
88RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
89# git clone uses cached copy, doesn't pick up latest
90RUN git -C /opt/ansible pull
91RUN git -C /opt/ansible/lib/ansible/modules/core pull
92RUN git -C /opt/ansible/v2/ansible/modules/core pull
93ADD ansible-hosts /etc/ansible/hosts
94
95
96# For Observer
97ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
98RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
99RUN cd /tmp/fofum; python setup.py install
100RUN rm -rf /tmp/fofum
101
102RUN mkdir -p /usr/local/share /bin
103ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
104RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
105RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
106RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
107RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
108
109# Get XOS
110RUN git clone git://github.com/open-cloud/xos.git /tmp/xos && mv /tmp/xos/xos /opt/
111
112RUN chmod +x /opt/xos/scripts/opencloud
113
114RUN /opt/xos/scripts/opencloud genkeys
115
116# Workaround for AUFS issue
117# https://github.com/docker/docker/issues/783#issuecomment-56013588
118RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
119
120# Set postgres password to match default value in settings.py
121RUN service postgresql start && sudo -u postgres psql -c "alter user postgres with password 'password';"
122
123# Turn DEBUG on so that devel server will serve static files
124# (not necessary if --insecure is passed to 'manage.py runserver')
125# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
126
127# Cruft to workaround problems with migrations, should go away...
128RUN /opt/xos/scripts/opencloud remigrate
129
130
131# install Tosca engine
132RUN bash /opt/xos/tosca/install_tosca.sh
133
134# configure nginx
135RUN cp /opt/xos/nginx/xos.conf /etc/nginx/sites-enabled/default
136
137# Supervisor configuration
138RUN cp /opt/xos/configurations/opencloud/supervisord.conf /etc/supervisor/conf.d/xos-all.conf
139
140EXPOSE 8000
141
142# Define default command.
143CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/xos-all.conf