blob: 584e21e9869e00297fdde35dd35a22334a0790fe [file] [log] [blame]
Tony Mack9f797af2015-09-30 16:02:26 +00001FROM ubuntu:14.04.2
2MAINTAINER Andy Bavier <acb@cs.princeton.edu>
3
4# Set environment variables.
5ENV HOME /root
6ENV TOSCA_CONFIG_PATH=/opt/xos/configurations/opencloud/opencloud.tosca
7
8# XXX Workaround for docker bug:
9# https://github.com/docker/docker/issues/6345
10# Kernel 3.15 breaks docker, uss the line below as a workaround
11# until there is a fix
12RUN ln -s -f /bin/true /usr/bin/chfn
13# XXX End workaround
14
15# Install.
16RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
17 git \
18 postgresql \
19 graphviz \
20 graphviz-dev \
21 libxslt1.1 \
22 libxslt1-dev \
23 tar \
24 gcc \
25 geoip-database \
26 libgeoip1 \
27 openssh-client \
28 wget \
29 curl \
30 python-dev \
31 libyaml-dev \
32 pkg-config \
33 supervisor \
Tony Mackca8c2232015-10-08 20:19:11 +000034 python-crypto \
35 python-httplib2>=0.9.1 \
Tony Mack9f797af2015-09-30 16:02:26 +000036 python-jinja2 \
37 python-paramiko \
38 python-pip \
39 python-psycopg2 \
40 python-pycurl \
41 python-setuptools \
42 python-yaml \
43 python-keystoneclient \
44 python-novaclient \
45 python-neutronclient \
46 python-glanceclient \
47 python-ceilometerclient
48
49RUN pip install \
Tony Mackca8c2232015-10-08 20:19:11 +000050 django==1.7 \
Tony Mack9f797af2015-09-30 16:02:26 +000051 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-keyczar \
69 pygraphviz \
70 dnslib
71
Tony Mackca8c2232015-10-08 20:19:11 +000072RUN easy_install --upgrade httplib2
73
Tony Mack9f797af2015-09-30 16:02:26 +000074RUN easy_install \
Tony Mackca8c2232015-10-08 20:19:11 +000075 django_evolution \
Tony Mack9f797af2015-09-30 16:02:26 +000076 python_gflags \
77 google_api_python_client \
78 httplib2.ca_certs_locater
79
Tony Mack9f797af2015-09-30 16:02:26 +000080
81# Install custom Ansible
82RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
83RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
84RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
85RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
86RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
87ADD ansible-hosts /etc/ansible/hosts
88
89ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
90
91# For Observer
92RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
93RUN cd /tmp/fofum; python setup.py install
94RUN rm -rf /tmp/fofum
95
96RUN mkdir -p /usr/local/share /bin
97ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
98RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
99RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
100RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
101RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
102
103# Supervisor
104ADD observer.conf /etc/supervisor/conf.d/
105
106# Get XOS
107ADD xos /opt/xos
108
109# Initscript is broken in Ubuntu
110#ADD observer-initscript /etc/init.d/xosobserver
111
112RUN chmod +x /opt/xos/scripts/opencloud
113RUN /opt/xos/scripts/opencloud genkeys
114
115# Workaround for AUFS issue
116# https://github.com/docker/docker/issues/783#issuecomment-56013588
117RUN 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
118
119# Set postgres password to match default value in settings.py
120RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';"
121
122# Turn DEBUG on so that devel server will serve static files
123# (not necessary if --insecure is passed to 'manage.py runserver')
124# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
125
126# Cruft to workaround problems with migrations, should go away...
127RUN /opt/xos/scripts/opencloud remigrate
128
129# git clone uses cached copy, doesn't pick up latest
130RUN git -C /opt/ansible pull
131RUN git -C /opt/ansible/lib/ansible/modules/core pull
132RUN git -C /opt/ansible/v2/ansible/modules/core pull
133
134# install Tosca engine
135RUN apt-get install -y m4
136RUN pip install python-dateutil
137RUN bash /opt/xos/tosca/install_tosca.sh
138RUN /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH}
139
140EXPOSE 8000
141
142# Set environment variables.
143ENV HOME /root
144
145# Define working directory.
146WORKDIR /root
147
148# Define default command.
149#CMD ["/bin/bash"]
150CMD /opt/xos/scripts/docker_start_xos