S.Çağlar Onur | 89d0ce7 | 2015-02-23 11:11:12 -0500 | [diff] [blame] | 1 | FROM ubuntu:14.04.2 |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 2 | MAINTAINER Andy Bavier <acb@cs.princeton.edu> |
| 3 | |
Tony Mack | 4faa5f9 | 2015-02-10 16:47:12 -0500 | [diff] [blame] | 4 | # 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 |
| 8 | RUN ln -s -f /bin/true /usr/bin/chfn |
| 9 | # XXX End workaround |
| 10 | |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 11 | # Install. |
Tony Mack | 2d6c9ad | 2015-09-22 15:57:36 +0000 | [diff] [blame^] | 12 | RUN 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 \ |
| 26 | wget \ |
| 27 | curl \ |
| 28 | python-dev \ |
| 29 | libyaml-dev \ |
| 30 | pkg-config \ |
| 31 | python-pycurl |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 32 | |
| 33 | RUN pip install django==1.7 |
| 34 | RUN pip install djangorestframework==2.4.4 |
| 35 | RUN pip install markdown # Markdown support for the browseable API. |
| 36 | RUN pip install pyyaml # YAML content-type support. |
| 37 | RUN pip install django-filter # Filtering support |
| 38 | RUN pip install lxml # XML manipulation library |
| 39 | RUN pip install netaddr # IP Addr library |
| 40 | RUN pip install pytz |
| 41 | RUN pip install django-timezones |
| 42 | RUN pip install requests |
| 43 | RUN pip install django-crispy-forms |
| 44 | RUN pip install django-geoposition |
| 45 | RUN pip install django-extensions |
| 46 | RUN pip install django-suit |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 47 | RUN pip install django-bitfield |
| 48 | RUN pip install django-ipware |
| 49 | RUN pip install django-encrypted-fields |
| 50 | RUN pip install python-keyczar |
Scott Baker | 8251e7b | 2015-04-27 17:06:51 -0700 | [diff] [blame] | 51 | RUN pip install pygraphviz |
Scott Baker | 0df6855 | 2015-05-18 09:25:15 -0700 | [diff] [blame] | 52 | RUN pip install dnslib |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 53 | |
Andy Bavier | 4578ae7 | 2015-02-10 16:37:33 -0500 | [diff] [blame] | 54 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient |
| 55 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient |
| 56 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient |
| 57 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient |
| 58 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 59 | |
| 60 | RUN pip install django_rest_swagger |
| 61 | |
Andy Bavier | 4578ae7 | 2015-02-10 16:37:33 -0500 | [diff] [blame] | 62 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 63 | RUN easy_install django_evolution |
| 64 | RUN easy_install python_gflags |
Andy Bavier | 9e12bed | 2015-05-18 16:36:07 -0400 | [diff] [blame] | 65 | RUN easy_install --upgrade httplib2 |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 66 | RUN easy_install google_api_python_client |
| 67 | |
Andy Bavier | cabca60 | 2015-02-11 17:07:36 -0500 | [diff] [blame] | 68 | # Install custom Ansible |
| 69 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto |
| 70 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml |
| 71 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client |
| 72 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko |
| 73 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2 |
| 74 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2 |
| 75 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible |
| 76 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras |
| 77 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras |
| 78 | RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core |
| 79 | RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 80 | ADD ansible-hosts /etc/ansible/hosts |
| 81 | |
| 82 | ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/ |
| 83 | |
Andy Bavier | ea97965 | 2015-02-10 14:01:07 -0500 | [diff] [blame] | 84 | # For Observer |
| 85 | RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum |
| 86 | RUN cd /tmp/fofum; python setup.py install |
S.Çağlar Onur | 89d0ce7 | 2015-02-23 11:11:12 -0500 | [diff] [blame] | 87 | RUN rm -rf /tmp/fofum |
Andy Bavier | ea97965 | 2015-02-10 14:01:07 -0500 | [diff] [blame] | 88 | |
S.Çağlar Onur | d30d635 | 2015-02-12 11:55:19 -0500 | [diff] [blame] | 89 | RUN mkdir -p /usr/local/share /bin |
| 90 | ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/ |
S.Çağlar Onur | afb88a5 | 2015-02-12 12:02:10 -0500 | [diff] [blame] | 91 | RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/ |
S.Çağlar Onur | d30d635 | 2015-02-12 11:55:19 -0500 | [diff] [blame] | 92 | RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 |
| 93 | RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs |
| 94 | RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs |
| 95 | |
Andy Bavier | 6d23fcb | 2015-04-24 10:52:27 -0400 | [diff] [blame] | 96 | # Supervisor |
| 97 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor |
| 98 | ADD observer.conf /etc/supervisor/conf.d/ |
| 99 | |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 100 | # Get XOS |
Scott Baker | 2939741 | 2015-02-18 22:30:22 -0800 | [diff] [blame] | 101 | ADD xos /opt/xos |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 102 | |
Scott Baker | 1c36afb | 2015-02-19 13:33:58 -0800 | [diff] [blame] | 103 | # Initscript is broken in Ubuntu |
| 104 | #ADD observer-initscript /etc/init.d/xosobserver |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 105 | |
| 106 | RUN chmod +x /opt/xos/scripts/opencloud |
| 107 | RUN /opt/xos/scripts/opencloud genkeys |
| 108 | |
Andy Bavier | dfcc6e0 | 2015-03-13 14:01:47 -0400 | [diff] [blame] | 109 | # Workaround for AUFS issue |
| 110 | # https://github.com/docker/docker/issues/783#issuecomment-56013588 |
| 111 | RUN 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 |
| 112 | |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 113 | # Set postgres password to match default value in settings.py |
| 114 | RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';" |
| 115 | |
| 116 | # Turn DEBUG on so that devel server will serve static files |
Scott Baker | e3f15de | 2015-06-23 00:28:32 -0700 | [diff] [blame] | 117 | # (not necessary if --insecure is passed to 'manage.py runserver') |
| 118 | # RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 119 | |
| 120 | # Cruft to workaround problems with migrations, should go away... |
Scott Baker | 6ada925 | 2015-02-18 16:50:48 -0800 | [diff] [blame] | 121 | RUN /opt/xos/scripts/opencloud remigrate |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 122 | |
Andy Bavier | 6d23fcb | 2015-04-24 10:52:27 -0400 | [diff] [blame] | 123 | # git clone uses cached copy, doesn't pick up latest |
| 124 | RUN git -C /opt/ansible pull |
Andy Bavier | 1388bd4 | 2015-05-18 15:29:53 -0400 | [diff] [blame] | 125 | RUN git -C /opt/ansible/lib/ansible/modules/core pull |
| 126 | RUN git -C /opt/ansible/v2/ansible/modules/core pull |
Andy Bavier | 6d23fcb | 2015-04-24 10:52:27 -0400 | [diff] [blame] | 127 | |
Scott Baker | c1d963d | 2015-08-10 18:47:01 -0700 | [diff] [blame] | 128 | # install Tosca engine |
| 129 | RUN apt-get install -y m4 |
| 130 | RUN pip install python-dateutil |
| 131 | RUN bash /opt/xos/tosca/install_tosca.sh |
| 132 | |
Andy Bavier | 3704434 | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 133 | EXPOSE 8000 |
| 134 | |
| 135 | # Set environment variables. |
| 136 | ENV HOME /root |
| 137 | |
| 138 | # Define working directory. |
| 139 | WORKDIR /root |
| 140 | |
| 141 | # Define default command. |
Andy Bavier | c3f9170 | 2015-03-13 14:52:52 -0400 | [diff] [blame] | 142 | #CMD ["/bin/bash"] |
Scott Baker | 56c4902 | 2015-07-22 14:56:17 -0700 | [diff] [blame] | 143 | CMD /opt/xos/scripts/docker_start_xos |