blob: 0a37a23a18e29e7544b010b748bddb290989dc32 [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"]
16
17# Install golang protobuf
18#RUN go get github.com/golang/protobuf/protoc-gen-go
19#RUN go get google.golang.org/genproto/googleapis/rpc/status
20#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
21
22# Copy files
23#ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
24#ADD common $GOPATH/src/github.com/opencord/voltha-go/common
25#ADD db $GOPATH/src/github.com/opencord/voltha-go/db
26#ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
27ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
28#ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
29
30
31# Copy required proto files
32# ... VOLTHA proos
33ADD protos/*.proto /src/protos/
34ADD protos/scripts/* /src/protos/
35ADD afrouter/arouter.json /src
36
37#
38# Copy generated executables here
39WORKDIR $GOPATH/src/github.com/opencord/voltha-go
40
41#RUN ls -ltrR /go/src/github.com/opencord/voltha-go
42
43# Install golang protobuf
44#RUN go get github.com/golang/protobuf/protoc-gen-go
45#RUN go get google.golang.org/genproto/googleapis/rpc/status
46#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
47RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
48
49# Compile protobuf files
50RUN sh /src/protos/build_protos.sh /src/protos
51
52# Build rw_core
53#RUN cd afrouter && go build -o /src/afrouter
54
55
56# -------------
57# Image creation stage
58
59#FROM alpine:3.6
60
61# Set the working directory
62#WORKDIR /app
63
64# Copy required files
65#COPY --from=build-env /src/afrouter /app/
66#COPY --from=build-env /src/arouter.json /app/
67#COPY --from=build-env /src/protos/voltha.pb /app/
68#WORKDIR config
69#WORKDIR /app
70
71#CMD cd /app && ./arouter -config config/arouter.voltha2.json
72
73# Set the config volume
74