enable profile and race detection builds

Change-Id: I043d3a55d2d918d485d7bf286392078a147bcb33
diff --git a/Makefile b/Makefile
index 3fd497b..d8d09d1 100644
--- a/Makefile
+++ b/Makefile
@@ -79,9 +79,12 @@
 build: docker-build ## Alias for 'docker build'
 
 docker-build: local-protos local-lib-go ## Build openolt adapter docker image (set BUILD_PROFILED=true to also build the profiled image)
-	docker build $(DOCKER_BUILD_ARGS) --target ${DOCKER_TARGET} -t ${ADAPTER_IMAGENAME} -f docker/Dockerfile.openolt .
+	docker build $(DOCKER_BUILD_ARGS) --target=${DOCKER_TARGET} --build-arg CGO_PARAMETER=0 -t ${ADAPTER_IMAGENAME} -f docker/Dockerfile.openolt .
 ifdef BUILD_PROFILED
-	docker build $(DOCKER_BUILD_ARGS) --target ${DOCKER_TARGET} --build-arg EXTRA_GO_BUILD_TAGS="-tags profile" -t ${ADAPTER_IMAGENAME}-profile -f docker/Dockerfile.openolt .
+	docker build $(DOCKER_BUILD_ARGS) --target=dev --build-arg CGO_PARAMETER=1 --build-arg EXTRA_GO_BUILD_TAGS="-tags profile" -t ${ADAPTER_IMAGENAME}-profile -f docker/Dockerfile.openolt .
+endif
+ifdef BUILD_RACE
+	docker build $(DOCKER_BUILD_ARGS) --target=dev --build-arg CGO_PARAMETER=1 --build-arg EXTRA_GO_BUILD_TAGS="-race" -t ${ADAPTER_IMAGENAME}-rd -f docker/Dockerfile.openolt .
 endif
 
 docker-push: ## Push the docker images to an external repository
@@ -89,6 +92,9 @@
 ifdef BUILD_PROFILED
 	docker push ${ADAPTER_IMAGENAME}-profile
 endif
+ifdef BUILD_RACE
+	docker push ${ADAPTER_IMAGENAME}-rd
+endif
 
 docker-kind-load: ## Load docker images into a KinD cluster
 	@if [ "`kind get clusters | grep voltha-$(TYPE)`" = '' ]; then echo "no voltha-$(TYPE) cluster found" && exit 1; fi