change base image of xos container to python:2.7.11 docker image. fix bugs
diff --git a/containers/xos/Dockerfile b/containers/xos/Dockerfile
index 38e08a1..dfb4b63 100644
--- a/containers/xos/Dockerfile
+++ b/containers/xos/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:14.04.3
+FROM python:2.7.11
# XXX Workaround for docker bug:
# https://github.com/docker/docker/issues/6345
@@ -36,12 +36,11 @@
python-glanceclient \
python-ceilometerclient
-RUN pip install -U \
+RUN pip install \
django==1.7 \
django-bitfield \
django-crispy-forms \
django-encrypted-fields \
- django_evolution \
django-extensions \
django-filter \
django-geoposition \
@@ -51,20 +50,27 @@
django-timezones \
djangorestframework==2.4.4 \
dnslib \
- google_api_python_client \
- httplib2 \
- httplib2.ca_certs_locater \
lxml \
markdown \
netaddr \
+ pyOpenSSL \
+ psycopg2 \
+ python-ceilometerclient \
python-dateutil \
- python_gflags \
python-keyczar \
pygraphviz \
pytz \
pyyaml \
requests
+RUN easy_install --upgrade httplib2
+
+RUN easy_install \
+ django_evolution \
+ python_gflags \
+ google_api_python_client \
+ httplib2.ca_certs_locater
+
ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
# Install XOS
@@ -82,7 +88,7 @@
ENV HOME /root
# Define working directory.
-WORKDIR /root
+WORKDIR /opt/xos
# Define default command.
-CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure
+CMD python manage.py runserver 0.0.0.0:8000 --insecure
diff --git a/containers/xos/Makefile b/containers/xos/Makefile
index 367f0ec..833046b 100644
--- a/containers/xos/Makefile
+++ b/containers/xos/Makefile
@@ -6,13 +6,13 @@
NO_DOCKER_CACHE?=false
.PHONY: build
-build: ; docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+build: ; make -C ../../xos/configurations/common -f Makefile.cloudlab; docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
.PHONY: custom
custom: ; cat Dockerfile.templ | sed -e "s|XOS_GIT_REPO|${XOS_GIT_REPO}|g" -e "s|XOS_GIT_BRANCH|${XOS_GIT_BRANCH}|g" | docker build --no-cache=${NO_DOCKER_CACHE} -
.PHONY: run
-run: ; docker run -d --name ${CONTAINER_NAME} -p 80:8000 ${IMAGE_NAME}
+run: ; docker run -d --name ${CONTAINER_NAME} -p 80:8000 -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro ${IMAGE_NAME}
.PHONY: runtosca
runtosca: ; docker exec -it ${CONTAINER_NAME} /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH}
diff --git a/containers/xos/initdb b/containers/xos/initdb
index 41e0a9a..ac666c9 100755
--- a/containers/xos/initdb
+++ b/containers/xos/initdb
@@ -5,13 +5,12 @@
DB_HOST=$(wget http://ipinfo.io/ip -qO -)
# configure db host
-docker run -it --name=$CONTAINER_NAME $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_config
+docker run -it --name=$CONTAINER_NAME $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_configuration/xos_common_config
docker commit $CONTAINER_NAME $IMAGE_NAME
docker rm $CONTAINER_NAME
# init db schema
docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/scripts/opencloud makemigrations
# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
-echo docker commit --change="CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
docker commit --change="CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
docker rm $CONTAINER_NAME