Fixing docker build for race and profiling images
Change-Id: I6b28d5ff8e452ccb96016302f9c2dc70baacb695
diff --git a/docker/Dockerfile.rw_core b/docker/Dockerfile.rw_core
index b63c3e1..15f0ad7 100644
--- a/docker/Dockerfile.rw_core
+++ b/docker/Dockerfile.rw_core
@@ -34,6 +34,8 @@
ARG EXTRA_GO_BUILD_TAGS=""
+ARG CGO_PARAMETER="CGO_ENABLED=0"
+
ARG org_label_schema_version=unknown
ARG org_label_schema_vcs_url=unknown
ARG org_label_schema_vcs_ref=unknown
@@ -45,7 +47,7 @@
WORKDIR /go/src/rw_core
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN \
-CGO_ENABLED=0 go build $EXTRA_GO_BUILD_TAGS -mod=vendor -o /app/rw_core \
+export ${CGO_PARAMETER?} && go build $EXTRA_GO_BUILD_TAGS -mod=vendor -o /app/rw_core \
-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 \