[VOL-3825] Support configuration of go profiling (pprof)

Change-Id: I8c9731b420f3500b22174d1188253e7a074f2c35
diff --git a/Makefile b/Makefile
old mode 100644
new mode 100755
index 89c76d7..95b0f53
--- a/Makefile
+++ b/Makefile
@@ -102,11 +102,17 @@
 
 build: docker-build
 
-docker-build: local-protos local-lib-go
+docker-build: local-protos local-lib-go ## Build openonu adapter docker image (set BUILD_PROFILED=true to also build the profiled image)
 	docker build $(DOCKER_BUILD_ARGS) -t ${ADAPTER_IMAGENAME} -f docker/Dockerfile.openonu .
+ifdef BUILD_PROFILED
+	docker build $(DOCKER_BUILD_ARGS) --build-arg EXTRA_GO_BUILD_TAGS="-tags profile" -t ${ADAPTER_IMAGENAME}-profile -f docker/Dockerfile.openonu .
+endif
 
 docker-push:
 	docker push ${ADAPTER_IMAGENAME}
+ifdef BUILD_PROFILED
+	docker push ${ADAPTER_IMAGENAME}-profile
+endif
 
 docker-kind-load:
 	@if [ "`kind get clusters | grep voltha-$(TYPE)`" = '' ]; then echo "no voltha-$(TYPE) cluster found" && exit 1; fi
diff --git a/VERSION b/VERSION
old mode 100644
new mode 100755
index 6085e94..23aa839
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.1
+1.2.2
diff --git a/cmd/openonu-adapter/profile.go b/cmd/openonu-adapter/profile.go
index a093ee8..039c34d 100644
--- a/cmd/openonu-adapter/profile.go
+++ b/cmd/openonu-adapter/profile.go
@@ -25,6 +25,7 @@
 )
 
 func realMain(ctx context.Context) {
+	logger.Infoln(ctx, "Start server at 0.0.0.0:6060")
 	go func() {
 		logger.Fatal(ctx, http.ListenAndServe("0.0.0.0:6060", nil))
 	}()
diff --git a/docker/Dockerfile.openonu b/docker/Dockerfile.openonu
old mode 100644
new mode 100755
index ccb2552..ca9f7fb
--- a/docker/Dockerfile.openonu
+++ b/docker/Dockerfile.openonu
@@ -26,6 +26,8 @@
 # Copy common files.
 COPY . .
 
+ARG EXTRA_GO_BUILD_TAGS=""
+
 ARG org_label_schema_version=unknown
 ARG org_label_schema_vcs_url=unknown
 ARG org_label_schema_vcs_ref=unknown
@@ -35,7 +37,7 @@
 
 # Build openonu
 SHELL ["/bin/ash", "-o", "pipefail", "-c"]
-RUN go build -mod=vendor -o /go/bin/openonu \
+RUN go build $EXTRA_GO_BUILD_TAGS -mod=vendor -o /go/bin/openonu \
 	-ldflags \
 	"-X github.com/opencord/voltha-lib-go/v4/pkg/version.version=$org_label_schema_version \
 	 -X github.com/opencord/voltha-lib-go/v4/pkg/version.vcsRef=$org_label_schema_vcs_ref  \