Tony Mack | 9f797af | 2015-09-30 16:02:26 +0000 | [diff] [blame] | 1 | FROM ubuntu:14.04.2 |
| 2 | MAINTAINER Andy Bavier <acb@cs.princeton.edu> |
| 3 | |
| 4 | # Set environment variables. |
| 5 | ENV HOME /root |
| 6 | ENV 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 |
| 12 | RUN ln -s -f /bin/true /usr/bin/chfn |
| 13 | # XXX End workaround |
| 14 | |
| 15 | # Install. |
| 16 | RUN 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 Mack | ca8c223 | 2015-10-08 20:19:11 +0000 | [diff] [blame^] | 34 | python-crypto \ |
| 35 | python-httplib2>=0.9.1 \ |
Tony Mack | 9f797af | 2015-09-30 16:02:26 +0000 | [diff] [blame] | 36 | 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 | |
| 49 | RUN pip install \ |
Tony Mack | ca8c223 | 2015-10-08 20:19:11 +0000 | [diff] [blame^] | 50 | django==1.7 \ |
Tony Mack | 9f797af | 2015-09-30 16:02:26 +0000 | [diff] [blame] | 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-keyczar \ |
| 69 | pygraphviz \ |
| 70 | dnslib |
| 71 | |
Tony Mack | ca8c223 | 2015-10-08 20:19:11 +0000 | [diff] [blame^] | 72 | RUN easy_install --upgrade httplib2 |
| 73 | |
Tony Mack | 9f797af | 2015-09-30 16:02:26 +0000 | [diff] [blame] | 74 | RUN easy_install \ |
Tony Mack | ca8c223 | 2015-10-08 20:19:11 +0000 | [diff] [blame^] | 75 | django_evolution \ |
Tony Mack | 9f797af | 2015-09-30 16:02:26 +0000 | [diff] [blame] | 76 | python_gflags \ |
| 77 | google_api_python_client \ |
| 78 | httplib2.ca_certs_locater |
| 79 | |
Tony Mack | 9f797af | 2015-09-30 16:02:26 +0000 | [diff] [blame] | 80 | |
| 81 | # Install custom Ansible |
| 82 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible |
| 83 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras |
| 84 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras |
| 85 | RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core |
| 86 | RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core |
| 87 | ADD ansible-hosts /etc/ansible/hosts |
| 88 | |
| 89 | ADD 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 |
| 92 | RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum |
| 93 | RUN cd /tmp/fofum; python setup.py install |
| 94 | RUN rm -rf /tmp/fofum |
| 95 | |
| 96 | RUN mkdir -p /usr/local/share /bin |
| 97 | ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/ |
| 98 | RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/ |
| 99 | RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 |
| 100 | RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs |
| 101 | RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs |
| 102 | |
| 103 | # Supervisor |
| 104 | ADD observer.conf /etc/supervisor/conf.d/ |
| 105 | |
| 106 | # Get XOS |
| 107 | ADD xos /opt/xos |
| 108 | |
| 109 | # Initscript is broken in Ubuntu |
| 110 | #ADD observer-initscript /etc/init.d/xosobserver |
| 111 | |
| 112 | RUN chmod +x /opt/xos/scripts/opencloud |
| 113 | RUN /opt/xos/scripts/opencloud genkeys |
| 114 | |
| 115 | # Workaround for AUFS issue |
| 116 | # https://github.com/docker/docker/issues/783#issuecomment-56013588 |
| 117 | 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 |
| 118 | |
| 119 | # Set postgres password to match default value in settings.py |
| 120 | RUN 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... |
| 127 | RUN /opt/xos/scripts/opencloud remigrate |
| 128 | |
| 129 | # git clone uses cached copy, doesn't pick up latest |
| 130 | RUN git -C /opt/ansible pull |
| 131 | RUN git -C /opt/ansible/lib/ansible/modules/core pull |
| 132 | RUN git -C /opt/ansible/v2/ansible/modules/core pull |
| 133 | |
| 134 | # install Tosca engine |
| 135 | RUN apt-get install -y m4 |
| 136 | RUN pip install python-dateutil |
| 137 | RUN bash /opt/xos/tosca/install_tosca.sh |
| 138 | RUN /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH} |
| 139 | |
| 140 | EXPOSE 8000 |
| 141 | |
| 142 | # Set environment variables. |
| 143 | ENV HOME /root |
| 144 | |
| 145 | # Define working directory. |
| 146 | WORKDIR /root |
| 147 | |
| 148 | # Define default command. |
| 149 | #CMD ["/bin/bash"] |
| 150 | CMD /opt/xos/scripts/docker_start_xos |