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 |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 29 | RUN sh /src/protos/build_protos.sh /src/protos |
| 30 | |
| 31 | # Build rw_core |
| 32 | RUN cd arouterd && go build -o /src/arouterd |
| 33 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 34 | # ------------- |
| 35 | # Image creation stage |
| 36 | |
| 37 | FROM alpine:3.6 |
| 38 | |
| 39 | # Set the working directory |
| 40 | WORKDIR /app |
| 41 | |
| 42 | # Copy required files |
| 43 | COPY --from=build-env /src/arouterd /app/ |