VOL-3383 - add build with race condition detection
Change-Id: I52211a49cc5d7328895a851b0d0184ce1756c91e
diff --git a/docker/Dockerfile.rw_core b/docker/Dockerfile.rw_core
index 1b159f7..2533f88 100644
--- a/docker/Dockerfile.rw_core
+++ b/docker/Dockerfile.rw_core
@@ -15,10 +15,13 @@
# -------------
# Build stage
-FROM golang:1.13.8-alpine3.11 AS build-env
+ARG GOLANG_IMAGE=golang:1.13.8-alpine3.11
+ARG DEPLOY_IMAGE=alpine:3.11.3
+# hadolint ignore=DL3006
+FROM $GOLANG_IMAGE AS build-env
# Install required packages
-RUN apk add --no-cache build-base=0.5-r1
+RUN if command -v apk; then apk add --no-cache build-base=0.5-r1; fi
# Use Standard go build directory structure
WORKDIR /go/src
@@ -43,7 +46,10 @@
# Build
WORKDIR /go/src/rw_core
-SHELL ["/bin/ash", "-o", "pipefail", "-c"]
+# Need to ignore DL4006 as depending on the image being used different
+# shell may be used and there is no known way to parameterize the
+# Dockerfile SHELL command as build args did not seems to work
+# hadolint ignore=DL4006
RUN go build $EXTRA_GO_BUILD_TAGS -mod=vendor -o /go/bin/rw_core \
-ldflags \
"-X github.com/opencord/voltha-lib-go/v3/pkg/version.version=$org_label_schema_version \
@@ -57,7 +63,8 @@
# -------------
# Image creation stage
-FROM alpine:3.11.3
+# hadolint ignore=DL3006
+FROM $DEPLOY_IMAGE
# Set the working directory
WORKDIR /app