Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | FROM ubuntu:14.04.2 |
| 2 | MAINTAINER Andy Bavier <acb@cs.princeton.edu> |
| 3 | |
| 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 | |
| 11 | # Install. |
| 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 |
| 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==0.11.0 # 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 python-logstash |
| 44 | RUN pip install django-crispy-forms |
| 45 | RUN pip install django-geoposition |
| 46 | RUN pip install django-extensions |
| 47 | RUN pip install django-suit==0.3a1 |
| 48 | RUN pip install django-bitfield |
| 49 | RUN pip install django-ipware |
| 50 | RUN pip install django-encrypted-fields |
| 51 | RUN pip install python-keyczar |
| 52 | RUN pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/" |
| 53 | RUN pip install dnslib |
| 54 | |
| 55 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient |
| 56 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient |
| 57 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient |
| 58 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient |
| 59 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient |
| 60 | |
| 61 | RUN pip install django_rest_swagger |
| 62 | |
| 63 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools |
| 64 | RUN easy_install python_gflags |
| 65 | RUN easy_install --upgrade httplib2 |
| 66 | RUN easy_install google_api_python_client |
| 67 | RUN easy_install httplib2.ca_certs_locater |
| 68 | |
| 69 | # Install custom Ansible |
| 70 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto |
| 71 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml |
| 72 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client |
| 73 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko |
| 74 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2 |
| 75 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2 |
| 76 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible |
| 77 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras |
| 78 | RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras |
| 79 | RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core |
| 80 | RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core |
| 81 | ADD ansible-hosts /etc/ansible/hosts |
| 82 | |
| 83 | ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/ |
| 84 | |
| 85 | # For Observer |
| 86 | RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum |
| 87 | RUN cd /tmp/fofum; python setup.py install |
| 88 | RUN rm -rf /tmp/fofum |
| 89 | |
| 90 | RUN mkdir -p /usr/local/share /bin |
| 91 | ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/ |
| 92 | RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/ |
| 93 | RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 |
| 94 | RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs |
| 95 | RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs |
| 96 | |
| 97 | # Supervisor |
| 98 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor |
| 99 | ADD observer.conf /etc/supervisor/conf.d/ |
| 100 | |
| 101 | # Get XOS |
| 102 | ADD xos /opt/xos |
| 103 | |
| 104 | # Initscript is broken in Ubuntu |
| 105 | #ADD observer-initscript /etc/init.d/xosobserver |
| 106 | |
| 107 | RUN chmod +x /opt/xos/tools/xos-manage |
| 108 | RUN /opt/xos/tools/xos-manage genkeys |
| 109 | |
| 110 | # Workaround for AUFS issue |
| 111 | # https://github.com/docker/docker/issues/783#issuecomment-56013588 |
| 112 | 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 |
| 113 | |
| 114 | # Set postgres password to match default value in settings.py |
| 115 | RUN 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 |
| 118 | # (not necessary if --insecure is passed to 'manage.py runserver') |
| 119 | # RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py |
| 120 | |
| 121 | # Cruft to workaround problems with migrations, should go away... |
| 122 | RUN /opt/xos/tools/xos-manage remigrate |
| 123 | |
| 124 | # git clone uses cached copy, doesn't pick up latest |
| 125 | RUN git -C /opt/ansible pull |
| 126 | RUN git -C /opt/ansible/lib/ansible/modules/core pull |
| 127 | RUN git -C /opt/ansible/v2/ansible/modules/core pull |
| 128 | |
| 129 | # install Tosca engine |
| 130 | RUN apt-get install -y m4 |
| 131 | RUN pip install python-dateutil |
| 132 | RUN bash /opt/xos/tosca/install_tosca.sh |
| 133 | |
| 134 | EXPOSE 8000 |
| 135 | |
| 136 | # Set environment variables. |
| 137 | ENV HOME /root |
| 138 | |
| 139 | # Define working directory. |
| 140 | WORKDIR /root |
| 141 | |
| 142 | # Define default command. |
| 143 | #CMD ["/bin/bash"] |
| 144 | #CMD /opt/xos/tools/docker_start_xos |