blob: b69b7fdb3753861fc5a4c206d8ca48f5516c7e9c [file] [log] [blame]
Tony Mack40ef7a32015-10-27 15:48:26 -04001FROM ubuntu:14.04.3
Andy Bavier37044342015-02-06 16:39:06 -05002MAINTAINER 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
Andy Bavier87465f02015-09-29 10:18:02 -04007# until there is a fix
8RUN ln -s -f /bin/true /usr/bin/chfn
Tony Mack4faa5f92015-02-10 16:47:12 -05009# XXX End workaround
10
Andy Bavier37044342015-02-06 16:39:06 -050011# Install.
Tony Mack2d6c9ad2015-09-22 15:57:36 +000012RUN apt-get update && apt-get install -y \
13 git \
14 postgresql \
15 python-psycopg2 \
16 graphviz \
17 graphviz-dev \
18 libxslt1.1 \
19 libxslt1-dev \
20 python-pip \
21 tar \
22 gcc \
23 python-httplib2 \
24 geoip-database \
25 libgeoip1 \
Andy Bavier87465f02015-09-29 10:18:02 -040026 wget \
27 curl \
Tony Mack2d6c9ad2015-09-22 15:57:36 +000028 python-dev \
Andy Bavier87465f02015-09-29 10:18:02 -040029 libyaml-dev \
30 pkg-config \
31 python-pycurl
Andy Bavier37044342015-02-06 16:39:06 -050032
33RUN pip install django==1.7
34RUN pip install djangorestframework==2.4.4
35RUN pip install markdown # Markdown support for the browseable API.
36RUN pip install pyyaml # YAML content-type support.
37RUN pip install django-filter # Filtering support
38RUN pip install lxml # XML manipulation library
39RUN pip install netaddr # IP Addr library
40RUN pip install pytz
41RUN pip install django-timezones
42RUN pip install requests
43RUN pip install django-crispy-forms
44RUN pip install django-geoposition
45RUN pip install django-extensions
46RUN pip install django-suit
Andy Bavier37044342015-02-06 16:39:06 -050047RUN pip install django-bitfield
48RUN pip install django-ipware
49RUN pip install django-encrypted-fields
50RUN pip install python-keyczar
Scott Baker8251e7b2015-04-27 17:06:51 -070051RUN pip install pygraphviz
Scott Baker0df68552015-05-18 09:25:15 -070052RUN pip install dnslib
Andy Bavier37044342015-02-06 16:39:06 -050053
Andy Bavier4578ae72015-02-10 16:37:33 -050054RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient
55RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient
56RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient
57RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient
58RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient
Andy Bavier37044342015-02-06 16:39:06 -050059
60RUN pip install django_rest_swagger
61
Andy Bavier4578ae72015-02-10 16:37:33 -050062RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools
Andy Bavier37044342015-02-06 16:39:06 -050063RUN easy_install django_evolution
64RUN easy_install python_gflags
Andy Bavier9e12bed2015-05-18 16:36:07 -040065RUN easy_install --upgrade httplib2
Andy Bavier37044342015-02-06 16:39:06 -050066RUN easy_install google_api_python_client
Andy Bavier87465f02015-09-29 10:18:02 -040067RUN easy_install httplib2.ca_certs_locater
Andy Bavier37044342015-02-06 16:39:06 -050068
Andy Baviercabca602015-02-11 17:07:36 -050069# Install custom Ansible
70RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto
71RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml
72RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client
73RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko
74RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2
75RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2
76RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
77RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
78RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
79RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
80RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
Andy Bavier37044342015-02-06 16:39:06 -050081ADD ansible-hosts /etc/ansible/hosts
82
83ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
84
Andy Bavierea979652015-02-10 14:01:07 -050085# For Observer
86RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
87RUN cd /tmp/fofum; python setup.py install
S.Çağlar Onur89d0ce72015-02-23 11:11:12 -050088RUN rm -rf /tmp/fofum
Andy Bavierea979652015-02-10 14:01:07 -050089
S.Çağlar Onurd30d6352015-02-12 11:55:19 -050090RUN mkdir -p /usr/local/share /bin
91ADD 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 -050092RUN 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 -050093RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
94RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
95RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
96
Andy Bavier6d23fcb2015-04-24 10:52:27 -040097# Supervisor
98RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor
99ADD observer.conf /etc/supervisor/conf.d/
100
Andy Bavier87465f02015-09-29 10:18:02 -0400101# Get XOS
Scott Baker29397412015-02-18 22:30:22 -0800102ADD xos /opt/xos
Andy Bavier37044342015-02-06 16:39:06 -0500103
Scott Baker1c36afb2015-02-19 13:33:58 -0800104# Initscript is broken in Ubuntu
105#ADD observer-initscript /etc/init.d/xosobserver
Andy Bavier37044342015-02-06 16:39:06 -0500106
107RUN chmod +x /opt/xos/scripts/opencloud
108RUN /opt/xos/scripts/opencloud genkeys
109
Andy Bavierdfcc6e02015-03-13 14:01:47 -0400110# Workaround for AUFS issue
111# https://github.com/docker/docker/issues/783#issuecomment-56013588
112RUN 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
113
Andy Bavier37044342015-02-06 16:39:06 -0500114# Set postgres password to match default value in settings.py
115RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';"
116
117# Turn DEBUG on so that devel server will serve static files
Scott Bakere3f15de2015-06-23 00:28:32 -0700118# (not necessary if --insecure is passed to 'manage.py runserver')
119# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
Andy Bavier37044342015-02-06 16:39:06 -0500120
121# Cruft to workaround problems with migrations, should go away...
Scott Baker6ada9252015-02-18 16:50:48 -0800122RUN /opt/xos/scripts/opencloud remigrate
Andy Bavier37044342015-02-06 16:39:06 -0500123
Andy Bavier6d23fcb2015-04-24 10:52:27 -0400124# git clone uses cached copy, doesn't pick up latest
125RUN git -C /opt/ansible pull
Andy Bavier1388bd42015-05-18 15:29:53 -0400126RUN git -C /opt/ansible/lib/ansible/modules/core pull
127RUN git -C /opt/ansible/v2/ansible/modules/core pull
Andy Bavier6d23fcb2015-04-24 10:52:27 -0400128
Scott Bakerc1d963d2015-08-10 18:47:01 -0700129# install Tosca engine
130RUN apt-get install -y m4
131RUN pip install python-dateutil
132RUN bash /opt/xos/tosca/install_tosca.sh
133
Andy Bavier37044342015-02-06 16:39:06 -0500134EXPOSE 8000
135
136# Set environment variables.
137ENV HOME /root
138
139# Define working directory.
140WORKDIR /root
141
142# Define default command.
Andy Bavierc3f91702015-03-13 14:52:52 -0400143#CMD ["/bin/bash"]
Scott Baker56c49022015-07-22 14:56:17 -0700144CMD /opt/xos/scripts/docker_start_xos