SEBA-560 Remove ansible from synchronizer framework;
Resolve exception from NetworkX upgrade;
Revise Makefile to use standard docker options

Change-Id: Idb29ed71ba46f97d8561a702b4c7e75d541d4e2c
diff --git a/containers/chameleon/Dockerfile.chameleon b/containers/chameleon/Dockerfile.chameleon
index bb8e9da..52eb276 100644
--- a/containers/chameleon/Dockerfile.chameleon
+++ b/containers/chameleon/Dockerfile.chameleon
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/chameleon
-FROM xosproject/xos-base:3.0.5
+FROM xosproject/xos-base:3.0.6
 
 # xos-base already has protoc and dependencies installed
 
diff --git a/containers/xos/Dockerfile.client b/containers/xos/Dockerfile.client
index 6db1f11..428b4e3 100644
--- a/containers/xos/Dockerfile.client
+++ b/containers/xos/Dockerfile.client
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-client
-FROM xosproject/xos-libraries:3.0.5
+FROM xosproject/xos-libraries:3.0.6
 
 # Label image
 ARG org_label_schema_schema_version=1.0
diff --git a/containers/xos/Dockerfile.libraries b/containers/xos/Dockerfile.libraries
index 8c60ce1..9c08e63 100644
--- a/containers/xos/Dockerfile.libraries
+++ b/containers/xos/Dockerfile.libraries
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-libraries
-FROM xosproject/xos-base:3.0.5
+FROM xosproject/xos-base:3.0.6
 
 # Add libraries
 COPY lib /opt/xos/lib
diff --git a/containers/xos/Dockerfile.synchronizer-base b/containers/xos/Dockerfile.synchronizer-base
index 00e4766..0e88561 100644
--- a/containers/xos/Dockerfile.synchronizer-base
+++ b/containers/xos/Dockerfile.synchronizer-base
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-synchronizer-base
-FROM xosproject/xos-client:3.0.5
+FROM xosproject/xos-client:3.0.6
 
 COPY xos/xos/logger.py /opt/xos/xos/logger.py
 COPY xos/xos/__init__.py /opt/xos/xos/__init__.py
diff --git a/containers/xos/Dockerfile.xos-core b/containers/xos/Dockerfile.xos-core
index 2bdee57..1b4533c 100644
--- a/containers/xos/Dockerfile.xos-core
+++ b/containers/xos/Dockerfile.xos-core
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-core
-FROM xosproject/xos-libraries:3.0.5
+FROM xosproject/xos-libraries:3.0.6
 
 # Install XOS
 ADD xos /opt/xos
diff --git a/containers/xos/Makefile b/containers/xos/Makefile
index b17f92e..e0ffca1 100644
--- a/containers/xos/Makefile
+++ b/containers/xos/Makefile
@@ -18,36 +18,40 @@
 # Optional parameters are:
 # `REGISTRY=192.168.99.100:3000/ REPOSITORY=xosproject/ DOCKER_BUILD_ARGS="--no-cache" TAG=dev make build`
 
-ifeq ($(TAG),)
-TAG := candidate
-endif
+# Variables
+VERSION                  ?= $(shell cat ../../VERSION)
 
-ifeq ($(REPOSITORY),)
-REPOSITORY := xosproject/
-endif
+## Docker related
+DOCKER_REGISTRY          ?=
+DOCKER_REPOSITORY        ?=
+DOCKER_BUILD_ARGS        ?=
+DOCKER_TAG               ?= ${VERSION}
+DOCKER_IMAGENAME_BASE    := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}xos-base:${DOCKER_TAG}
+DOCKER_IMAGENAME_LIBRARIES := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}xos-libraries:${DOCKER_TAG}
+DOCKER_IMAGENAME_CLIENT  := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}xos-client:${DOCKER_TAG}
+DOCKER_IMAGENAME_CORE    := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}xos-core:${DOCKER_TAG}
+DOCKER_IMAGENAME_SYNC    := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}xos-synchronizer-base:${DOCKER_TAG}
 
 summary:
 	@echo Building images with:
 	@echo "    Build args:    $(DOCKER_BUILD_ARGS)"
-	@echo "    Registry:      ${REGISTRY}"
-	@echo "    Repository:    ${REPOSITORY}"
-	@echo "    Tag:           ${TAG}"
+	@echo "    Registry:      ${DOCKER_REGISTRY}"
+	@echo "    Repository:    ${DOCKER_REPOSITORY}"
+	@echo "    Tag:           ${DOCKER_TAG}"
 
 build: summary xos-base xos-libraries xos-client xos-core xos-synchronizer-base
 
 xos-base:
-	docker build $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}xos-base:${TAG} -f Dockerfile.base .
+	docker build $(DOCKER_BUILD_ARGS) -t ${DOCKER_IMAGENAME_BASE} -f Dockerfile.base .
 
 xos-libraries:
-	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}xos-libraries:${TAG} -f Dockerfile.libraries ../..
+	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${DOCKER_IMAGENAME_LIBRARIES} -f Dockerfile.libraries ../..
 
 xos-client:
-	rm -rf tmp.chameleon
-	cp -R ../../../../component/chameleon tmp.chameleon
-	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}xos-client:${TAG} -f Dockerfile.client ../..
+	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${DOCKER_IMAGENAME_CLIENT} -f Dockerfile.client ../..
 
 xos-core:
-	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}xos-core:${TAG} -f Dockerfile.xos-core ../..
+	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${DOCKER_IMAGENAME_CORE} -f Dockerfile.xos-core ../..
 
 xos-synchronizer-base:
-	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}xos-synchronizer-base:${TAG} -f Dockerfile.synchronizer-base ../..
+	docker build --no-cache $(DOCKER_BUILD_ARGS) -t ${DOCKER_IMAGENAME_SYNC} -f Dockerfile.synchronizer-base ../..