VOL-1460: Docker builds now use common base image. Also Documentation Update.
Modified all docker files to use a base build that copies in vendor and
other common GOPATH items. Then each dependant Dockerfile
uses the base and only copies in golang source needed to build.
Also grab updated lock file and vendor items missing (from a dep ensure)
for build to work.
Change-Id: I6047847c2c186a24d1f223b1a4dfab39ab381a92
diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base
index 1a22cd9..d07aacb 100644
--- a/docker/Dockerfile.base
+++ b/docker/Dockerfile.base
@@ -1,34 +1,20 @@
# -------------
# Build stage
-FROM golang:1.10-alpine
-
+FROM golang:1.10-alpine3.9
# Install required packages
-RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
-
-RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
+RUN apk add --no-cache wget git make build-base
# Prepare directory structure
-RUN ["mkdir", "-p", "/src"]
+RUN ["mkdir", "-p", "/build"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-go"]
-RUN ["mkdir", "-p", "/share"]
-# Copy files
-#ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
-#ADD common $GOPATH/src/github.com/opencord/voltha-go/common
-#ADD db $GOPATH/src/github.com/opencord/voltha-go/db
-#ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
-ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
-#ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
-
-ADD afrouter/arouter.json /src
-
-#
-# Copy generated executables here
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
-#RUN ls -ltrR /go/src/github.com/opencord/voltha-go
-
-VOLUME /share
+# Copy common files.
+COPY common ./common
+COPY db ./db
+COPY kafka ./kafka
+COPY vendor ./vendor