VOL-2006 update voltha-api-server to use go mod
Change-Id: Ic9cce461175dd08cc4f30ddda2172640e8928b00
diff --git a/docker/Dockerfile.afrouterd b/docker/Dockerfile.afrouterd
index 91cf4fd..e8d3487 100644
--- a/docker/Dockerfile.afrouterd
+++ b/docker/Dockerfile.afrouterd
@@ -27,19 +27,14 @@
protobuf-dev=3.6.1-r1
# Prepare directory structure
-RUN mkdir -p /build \
- "$GOPATH/src/" "$GOPATH/pkg" "$GOPATH/bin" \
- "$GOPATH/src/github.com/opencord" \
- "$GOPATH/src/github.com/opencord/voltha-api-server"
+RUN mkdir -p /build/src/arouterd \
+ "$GOPATH/src/" "$GOPATH/pkg" "$GOPATH/bin"
-WORKDIR $GOPATH/src/github.com/opencord/voltha-api-server
-# Copy common files.
-COPY vendor ./vendor
+WORKDIR /build/src/arouterd
-# Copy files
-COPY internal ./internal
-COPY cmd ./cmd
+# Copy source
+COPY . .
# Copy config
COPY arouter.json /build
@@ -52,9 +47,8 @@
ARG org_opencord_vcs_dirty=unknown
# Build
-WORKDIR $GOPATH/src/github.com/opencord/voltha-api-server
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
-RUN go build -o /build/arouterd \
+RUN go build -mod=vendor -o /build/arouterd \
-ldflags \
"-X github.com/opencord/voltha-go/common/version.version=$org_label_schema_version \
-X github.com/opencord/voltha-go/common/version.vcsRef=$org_label_schema_vcs_ref \