blob: 3e6098c39c91933e9b575d430c114556f5b09630 [file] [log] [blame]
sslobodr2fb98b82019-01-21 09:29:51 -05001# -------------
2# Build stage
3
4FROM golang:1.10-alpine
5
6
7# Install required packages
8RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
9
10RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
11
12# Prepare directory structure
13RUN ["mkdir", "-p", "/src", "src/protos"]
14RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
15RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
sslobodr38afd0d2019-01-21 12:31:46 -050016RUN ["mkdir", "-p", "/share"]
sslobodr2fb98b82019-01-21 09:29:51 -050017
18# Install golang protobuf
19#RUN go get github.com/golang/protobuf/protoc-gen-go
20#RUN go get google.golang.org/genproto/googleapis/rpc/status
21#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
22
23# Copy files
24#ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
25#ADD common $GOPATH/src/github.com/opencord/voltha-go/common
26#ADD db $GOPATH/src/github.com/opencord/voltha-go/db
27#ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
28ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
29#ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
30
31
32# Copy required proto files
33# ... VOLTHA proos
34ADD protos/*.proto /src/protos/
35ADD protos/scripts/* /src/protos/
36ADD afrouter/arouter.json /src
37
38#
39# Copy generated executables here
40WORKDIR $GOPATH/src/github.com/opencord/voltha-go
41
42#RUN ls -ltrR /go/src/github.com/opencord/voltha-go
43
44# Install golang protobuf
45#RUN go get github.com/golang/protobuf/protoc-gen-go
46#RUN go get google.golang.org/genproto/googleapis/rpc/status
47#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
48RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
49
50# Compile protobuf files
51RUN sh /src/protos/build_protos.sh /src/protos
52
sslobodr38afd0d2019-01-21 12:31:46 -050053VOLUME /share