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 | |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 16 | # Repeate here even if done in base file |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 17 | ADD afrouter/arouter.json /src |
| 18 | |
| 19 | # |
| 20 | # Copy generated executables here |
| 21 | WORKDIR $GOPATH/src/github.com/opencord/voltha-go |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 22 | |
| 23 | # Compile protobuf files |
sslobodr | 2fb98b8 | 2019-01-21 09:29:51 -0500 | [diff] [blame] | 24 | # Repeate here even if done in base file |
Stephane Barbarie | 260a563 | 2019-02-26 16:12:49 -0500 | [diff] [blame] | 25 | RUN go get google.golang.org/genproto/googleapis/api/annotations |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 26 | |
| 27 | # Build rw_core |
| 28 | RUN cd arouterd && go build -o /src/arouterd |
| 29 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 30 | # ------------- |
| 31 | # Image creation stage |
| 32 | |
| 33 | FROM alpine:3.6 |
| 34 | |
| 35 | # Set the working directory |
| 36 | WORKDIR /app |
| 37 | |
| 38 | # Copy required files |
| 39 | COPY --from=build-env /src/arouterd /app/ |