save python package versions in /var/xos
update to ubuntu 14.04.5
use requirements file for pip install

Change-Id: I1aa375e4ae374a65495fcbcbf9eb6a3b27b2710a
diff --git a/containers/xos/Dockerfile.base b/containers/xos/Dockerfile.base
index 9ad5b71..a511986 100644
--- a/containers/xos/Dockerfile.base
+++ b/containers/xos/Dockerfile.base
@@ -1,7 +1,7 @@
 # Dockerfile.base
 # This image isn't used, but installs the prereqs for the other XOS images
 
-FROM ubuntu:14.04.4
+FROM ubuntu:14.04.5
 MAINTAINER Zack Williams <zdw@cs.arizona.edu>
 
 # Install apt packages
@@ -30,54 +30,15 @@
     supervisor \
     unzip \
     wget \
- && rm -rf /var/lib/apt/lists/*
+ && rm -rf /var/lib/apt/lists/* \
+ && mkdir /var/xos \
+ && pip freeze > /var/xos/pip_freeze_apt_`date -u +%Y%m%dT%H%M%S`
 
 # Install python packages with pip
-RUN pip install \
-    ansible \
-    ca-certs-locater \
-    cryptography \
-    "django>=1.8,<1.8.99" \
-    django-bitfield \
-    django-crispy-forms \
-    django-encrypted-fields \
-    django-extensions \
-    django-filter \
-    django-ipware \
-    django-suit==0.3a3 \
-    django-timezones \
-    django_rest_swagger \
-    djangorestframework==3.3.3 \
-    dnslib \
-    google-api-python-client \
-    httplib2 \
-    jinja2 \
-    lxml \
-    markdown \
-    ndg-httpsclient \
-    netaddr \
-    psycopg2 \
-    pyOpenSSL \
-    pyasn1 \
-    pycrypto \
-    pycurl \
-    pygraphviz \
-    python-dateutil \
-    python-gflags \
-    python-keyczar \
-    python-logstash \
-    pytz \
-    pyyaml \
-    requests \
-    urllib3
+COPY pip_requirements.txt /tmp/pip_requirements.txt
 
-# uninstall cryptography
-RUN /usr/bin/yes | pip uninstall cryptography
-
-# Required for Ansible 2.x OpenStack os_* modules
-RUN pip install --upgrade pbr && \
-    pip install --upgrade six && \
-    pip install shade==1.9.0
+RUN pip install --no-deps -r /tmp/pip_requirements.txt \
+ && pip freeze > /var/xos/pip_freeze_pip_up_`date -u +%Y%m%dT%H%M%S`
 
 # Copy over ansible hosts
 COPY ansible-hosts /etc/ansible/hosts
diff --git a/containers/xos/Dockerfile.devel b/containers/xos/Dockerfile.devel
index a7a0994..21b4452 100644
--- a/containers/xos/Dockerfile.devel
+++ b/containers/xos/Dockerfile.devel
@@ -14,17 +14,18 @@
 ADD xos /opt/xos
 
 # ng-xos-lib download
-
 ENV NG_XOS_LIB_URL https://github.com/opencord/ng-xos-lib.git
 ENV NG_XOS_LIB_VERSION 1.0.0
 
-RUN git clone $NG_XOS_LIB_URL /tmp/ng-xos-lib 
-RUN cd /tmp/ng-xos-lib && git checkout tags/$NG_XOS_LIB_VERSION
-RUN cp /tmp/ng-xos-lib/dist/ngXosHelpers.min.js /opt/xos/core/xoslib/static/vendor/ 
-RUN cp /tmp/ng-xos-lib/dist/ngXosVendor.min.js /opt/xos/core/xoslib/static/vendor/
+RUN git clone $NG_XOS_LIB_URL /tmp/ng-xos-lib \
+ && cd /tmp/ng-xos-lib  \
+ && git checkout tags/$NG_XOS_LIB_VERSION \
+ && cp /tmp/ng-xos-lib/dist/ngXosHelpers.min.js /opt/xos/core/xoslib/static/vendor/ \
+ && cp /tmp/ng-xos-lib/dist/ngXosVendor.min.js /opt/xos/core/xoslib/static/vendor/
 
-RUN chmod +x /opt/xos/tools/xos-manage && sync && \
-    /opt/xos/tools/xos-manage genkeys
+RUN chmod +x /opt/xos/tools/xos-manage \
+ && sync \
+ && /opt/xos/tools/xos-manage genkeys
 
 EXPOSE 8000
 
diff --git a/containers/xos/Dockerfile.test b/containers/xos/Dockerfile.test
index 521007a..3d74883 100644
--- a/containers/xos/Dockerfile.test
+++ b/containers/xos/Dockerfile.test
@@ -1,14 +1,16 @@
-FROM       xosproject/xos
+FROM xosproject/xos
 
 # install nodejs
 COPY containers/xos/nodesource.gpg.key /tmp/nodesource.gpg.key
 
-RUN apt-key add /tmp/nodesource.gpg.key && \
-    echo "deb https://deb.nodesource.com/node_4.x trusty main" \
+RUN apt-key add /tmp/nodesource.gpg.key \
+ && echo "deb https://deb.nodesource.com/node_4.x trusty main" \
     > /etc/apt/sources.list.d/nodesource.list
 
-RUN apt-get update && apt-get install -y --force-yes nodejs && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt-get update \
+ && apt-get install -y --force-yes \
+    nodejs \
+ && rm -rf /var/lib/apt/lists/*
 
 RUN node -v
 
diff --git a/containers/xos/pip_requirements.txt b/containers/xos/pip_requirements.txt
new file mode 100644
index 0000000..4d67ceb
--- /dev/null
+++ b/containers/xos/pip_requirements.txt
@@ -0,0 +1,134 @@
+pytz==2016.6.1
+Babel==2.3.4
+Django==1.8.14
+Jinja2==2.8
+Markdown==2.6.6
+MarkupSafe==0.23
+Paste==2.0.3
+PasteDeploy==1.5.2
+PyYAML==3.12
+Routes==2.3.1
+WebOb==1.6.1
+amqp==1.4.9
+ansible==2.1.1.0
+anyjson==0.3.3
+appdirs==1.4.0
+argparse==1.2.1
+ca-certs-locater==1.0
+cachetools==1.1.6
+cffi==1.7.0
+chardet==2.0.1
+cliff==2.2.0
+cmd2==0.6.8
+colorama==0.2.5
+contextlib2==0.5.4
+coreapi==1.32.3
+debtcollector==1.8.0
+decorator==4.0.10
+django-bitfield==1.8.0
+django-crispy-forms==1.6.0
+django-encrypted-fields==1.1.2
+django-extensions==1.7.3
+django-filter==0.14.0
+django-ipware==1.1.5
+django-rest-swagger==2.0.5
+django-suit==0.3a3
+django-timezones==0.2
+djangorestframework==3.3.3
+dnslib==0.9.6
+dogpile.cache==0.6.2
+enum34==1.1.6
+eventlet==0.19.0
+fasteners==0.14.1
+funcsigs==1.0.2
+functools32==3.2.3-2
+futures==3.0.5
+futurist==0.18.0
+google-api-python-client==1.5.3
+greenlet==0.4.10
+html5lib==0.999
+httplib2==0.9.2
+idna==2.1
+ipaddress==1.0.16
+iso8601==0.1.11
+itypes==1.1.0
+jsonpatch==1.14
+jsonpointer==1.10
+jsonschema==2.5.1
+keystoneauth1==2.12.1
+kombu==3.0.35
+lxml==3.6.4
+meld3==0.6.10
+monotonic==1.2
+msgpack-python==0.4.8
+munch==2.0.4
+ndg-httpsclient==0.4.2
+netaddr==0.7.18
+netifaces==0.10.5
+oauth2client==3.0.0
+openapi-codec==1.0.0
+openstacksdk==0.9.4
+os-client-config==1.21.0
+osc-lib==1.1.0
+oslo.concurrency==3.14.0
+oslo.config==3.17.0
+oslo.context==2.9.0
+oslo.i18n==3.9.0
+oslo.log==3.16.0
+oslo.messaging==5.10.0
+oslo.middleware==3.19.0
+oslo.serialization==2.13.0
+oslo.service==1.16.0
+oslo.utils==3.16.0
+osprofiler==1.4.0
+paramiko==2.0.2
+pbr==1.10.0
+pika==0.10.0
+pika-pool==0.1.3
+positional==1.1.1
+prettytable==0.7.2
+psycopg2==2.6.2
+pyOpenSSL==16.1.0
+pyasn1==0.1.9
+pyasn1-modules==0.0.8
+pycparser==2.14
+pycrypto==2.6.1
+pycurl==7.43.0
+pygraphviz==1.3.1
+pyinotify==0.9.6
+pyparsing==2.1.8
+python-cinderclient==1.8.0
+python-dateutil==2.5.3
+python-designateclient==2.3.0
+python-gflags==3.0.6
+python-glanceclient==2.5.0
+python-heatclient==1.4.0
+python-ironicclient==1.6.0
+python-keyczar==0.716
+python-keystoneclient==3.5.0
+python-logstash==0.4.6
+python-magnumclient==2.3.0
+python-mistralclient==2.1.0
+python-neutronclient==5.1.0
+python-novaclient==5.1.0
+python-openstackclient==3.1.0
+python-swiftclient==3.0.0
+python-troveclient==2.5.0
+repoze.lru==0.6
+requests==2.11.1
+requestsexceptions==1.1.3
+retrying==1.3.3
+rfc3986==0.4.1
+rsa==3.4.2
+shade==1.9.0
+simplejson==3.8.2
+six==1.10.0
+stevedore==1.17.1
+supervisor==3.0b2
+unicodecsv==0.14.1
+uritemplate==0.6
+urllib3==1.7.1
+warlock==1.2.0
+wheel==0.24.0
+wrapt==1.10.8
+wsgiref==0.1.2