sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 1 | # ------------- |
| 2 | # Build stage |
| 3 | |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 4 | FROM base AS build-env |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 5 | |
| 6 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 7 | # Copy files |
| 8 | ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core |
| 9 | ADD common $GOPATH/src/github.com/opencord/voltha-go/common |
| 10 | ADD db $GOPATH/src/github.com/opencord/voltha-go/db |
| 11 | ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 12 | ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter |
| 13 | ADD arouterd $GOPATH/src/github.com/opencord/voltha-go/arouterd |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 14 | |
| 15 | |
| 16 | # Copy required proto files |
| 17 | # ... VOLTHA proos |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 18 | # Repeate here even if done in base file |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 19 | ADD protos/*.proto /src/protos/ |
| 20 | ADD protos/scripts/* /src/protos/ |
| 21 | ADD afrouter/arouter.json /src |
| 22 | |
| 23 | # |
| 24 | # Copy generated executables here |
| 25 | WORKDIR $GOPATH/src/github.com/opencord/voltha-go |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 26 | |
| 27 | # Compile protobuf files |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 28 | # Repeate here even if done in base file |
Stephane Barbarie | 260a563 | 2019-02-26 16:12:49 -0500 | [diff] [blame] | 29 | RUN go get google.golang.org/genproto/googleapis/api/annotations |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 30 | RUN sh /src/protos/build_protos.sh /src/protos |
| 31 | |
| 32 | # Build rw_core |
| 33 | RUN cd arouterd && go build -o /src/arouterd |
| 34 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 35 | # ------------- |
| 36 | # Image creation stage |
| 37 | |
| 38 | FROM alpine:3.6 |
| 39 | |
| 40 | # Set the working directory |
| 41 | WORKDIR /app |
| 42 | |
| 43 | # Copy required files |
| 44 | COPY --from=build-env /src/arouterd /app/ |