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 | # Copy files |
| 7 | ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core |
| 8 | ADD common $GOPATH/src/github.com/opencord/voltha-go/common |
| 9 | ADD db $GOPATH/src/github.com/opencord/voltha-go/db |
| 10 | ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 11 | ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter |
William Kurkian | daa6bb2 | 2019-03-07 12:26:28 -0500 | [diff] [blame^] | 12 | ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 13 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 14 | # Copy required proto files |
| 15 | # ... VOLTHA proos |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 16 | # Repeat here even if it's done in the base |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 17 | ADD afrouter/arouter.json /src |
William Kurkian | daa6bb2 | 2019-03-07 12:26:28 -0500 | [diff] [blame^] | 18 | COPY vendor/github.com/opencord/voltha-protos/go/voltha.pb /src |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 19 | |
| 20 | # |
| 21 | # Copy generated executables here |
| 22 | WORKDIR $GOPATH/src/github.com/opencord/voltha-go |
| 23 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 24 | # Build rw_core |
| 25 | RUN cd afrouter && go build -o /src/afrouter |
| 26 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 27 | # ------------- |
| 28 | # Image creation stage |
| 29 | |
| 30 | FROM alpine:3.6 |
| 31 | |
| 32 | # Set the working directory |
| 33 | WORKDIR /app |
| 34 | |
| 35 | # Copy required files |
| 36 | COPY --from=build-env /src/afrouter /app/ |
| 37 | COPY --from=build-env /src/arouter.json /app/ |
William Kurkian | daa6bb2 | 2019-03-07 12:26:28 -0500 | [diff] [blame^] | 38 | COPY --from=build-env /src/voltha.pb /app/ |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 39 | WORKDIR config |
| 40 | WORKDIR /app |
| 41 | |
| 42 | #CMD cd /app && ./arouter -config config/arouter.voltha2.json |
| 43 | |
| 44 | # Set the config volume |
| 45 | |