CORD-1551 - updated maas makefiles and multi-stage dockerfile
Change-Id: I0bab86e0207edb12f553ddcfe040882f04f34f25
diff --git a/roles/compute-node/files/remove-maas-components b/roles/compute-node/files/remove-maas-components
index 5adf79e..f3b09e7 100755
--- a/roles/compute-node/files/remove-maas-components
+++ b/roles/compute-node/files/remove-maas-components
@@ -1,7 +1,7 @@
#!/bin/bash
KEEP_DOCKER=0
-DOCKER_ENGINE="docker-engine"
+DOCKER_ENGINE="docker-ce"
DOCKER_REGISTRY="/docker-registry /docker-registry-mirror"
CONTAINER_LIST=$(docker ps -qa)
@@ -17,15 +17,11 @@
shift
done
-CONTAINER_LIST=$(docker ps --format '{{.ID}} {{.Names}}' | grep -v ' registry$' | grep -v ' registry-mirror$' | awk '{print $1}')
-
-docker kill $CONTAINER_LIST
-docker rm -f $CONTAINER_LIST
-if [ $KEEP_DOCKER -eq 0 ]; then
- docker rmi -f $(docker images -aq)
-fi
-
-sudo apt-get remove --purge -y bind9 apache2 $DOCKER_ENGINE ansible $(dpkg --get-selections | grep maas | cut -f1)
+docker rm -f $(docker ps -aq)
+docker rmi -f $(docker images -q)
+docker volume rm -f $(docker volume ls -q)
+docker network rm $(docker network ls -q)
+sudo apt-get remove --purge -y bind9 apache2 apt-cacher-ng $DOCKER_ENGINE ansible $(dpkg --get-selections | grep maas | cut -f1)
sudo rm -rf \
/etc/maas \
@@ -41,6 +37,7 @@
/etc/apt/sources.list.d/ppa_maas_stable_trusty.list \
/etc/apt/sources.list.d/ppa_ansible_ansible_trusty.list \
/etc/network/if-pre-up.d/nat \
+ /etc/apt/apt.conf.d/03apt-cacher-ng \
$DOCKER_REGISTRY
sudo apt-get update -y
diff --git a/roles/compute-node/files/remove-xos-components b/roles/compute-node/files/remove-xos-components
index 2f2cf07..d18eebe 100755
--- a/roles/compute-node/files/remove-xos-components
+++ b/roles/compute-node/files/remove-xos-components
@@ -24,6 +24,12 @@
sudo apt-get remove --purge -y $(dpkg --get-selections | grep "nagioas\|juju\|nova\|neutron" | awk '{print $1}') &&sudo apt-get autoremove -y && sudo rm -rf /etc/juju /etc/neutron /home/ubuntu/.juju && sudo find / -name "*juju*" -exec rm -r \{\} \; && sudo rm -f /var/lib/uvtool/libvirt/images/*
+sudo rm -rf \
+ /opt/cord* \
+ /opt/onos_* \
+ /opt/credentials \
+ /opt/images
+
OVS=$(which ovs-vsctl)
if [ ! -z $OVS ]; then