sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 1 | # ------------- |
| 2 | # Build stage |
| 3 | |
| 4 | FROM golang:1.10-alpine |
| 5 | |
| 6 | |
| 7 | # Install required packages |
| 8 | RUN apk add --no-cache wget git make build-base protobuf protobuf-dev |
| 9 | |
| 10 | RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis |
| 11 | |
| 12 | # Prepare directory structure |
| 13 | RUN ["mkdir", "-p", "/src", "src/protos"] |
| 14 | RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"] |
| 15 | RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"] |
sslobodr | 38afd0d | 2019-01-21 12:31:46 -0500 | [diff] [blame] | 16 | RUN ["mkdir", "-p", "/share"] |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 17 | |
| 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 |
| 28 | ADD 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 |
| 34 | ADD protos/*.proto /src/protos/ |
| 35 | ADD protos/scripts/* /src/protos/ |
| 36 | ADD afrouter/arouter.json /src |
| 37 | |
| 38 | # |
| 39 | # Copy generated executables here |
| 40 | WORKDIR $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 |
| 48 | RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go |
| 49 | |
| 50 | # Compile protobuf files |
| 51 | RUN sh /src/protos/build_protos.sh /src/protos |
| 52 | |
sslobodr | 38afd0d | 2019-01-21 12:31:46 -0500 | [diff] [blame] | 53 | VOLUME /share |