blob: 3e6098c39c91933e9b575d430c114556f5b09630 [file] [log] [blame]
# -------------
# Build stage
FROM golang:1.10-alpine
# 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
# Prepare directory structure
RUN ["mkdir", "-p", "/src", "src/protos"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
RUN ["mkdir", "-p", "/share"]
# Install golang protobuf
#RUN go get github.com/golang/protobuf/protoc-gen-go
#RUN go get google.golang.org/genproto/googleapis/rpc/status
#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
# 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
# Copy required proto files
# ... VOLTHA proos
ADD protos/*.proto /src/protos/
ADD protos/scripts/* /src/protos/
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
# Install golang protobuf
#RUN go get github.com/golang/protobuf/protoc-gen-go
#RUN go get google.golang.org/genproto/googleapis/rpc/status
#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
# Compile protobuf files
RUN sh /src/protos/build_protos.sh /src/protos
VOLUME /share