VOL-1921 - updated to use go mod
Change-Id: I8d5187fa91fa619494f972bc29d3bd61e5be3a82
diff --git a/docker/Dockerfile.openolt b/docker/Dockerfile.openolt
index 176a454..25f98f7 100644
--- a/docker/Dockerfile.openolt
+++ b/docker/Dockerfile.openolt
@@ -21,17 +21,8 @@
RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
# Prepare directory structure
-RUN ["mkdir", "-p", "/build"]
-RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-openolt-adapter"]
-
-WORKDIR $GOPATH/src/github.com/opencord/voltha-openolt-adapter
-
-COPY adaptercore ./adaptercore
-COPY config ./config
-COPY vendor ./vendor
-COPY *.go ./
+WORKDIR /go/src
+COPY . .
ARG org_label_schema_version=unknown
ARG org_label_schema_vcs_url=unknown
@@ -42,7 +33,8 @@
# Build openolt
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
-RUN go build -o /build/openolt \
+ENV GO111MODULE=on
+RUN go build -mod=vendor -o /go/bin/openolt \
-ldflags \
"-X github.com/opencord/voltha-openolt-adapter/config/version.version=$org_label_schema_version \
-X github.com/opencord/voltha-openolt-adapter/config/version.vcsRef=$org_label_schema_vcs_ref \
@@ -61,7 +53,7 @@
WORKDIR /app
# Copy required files
-COPY --from=build-env /build/openolt /app/
+COPY --from=build-env /go/bin/openolt /app/
# Label image
ARG org_label_schema_version=unknown