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 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 6 | WORKDIR $GOPATH/src/github.com/opencord/voltha-go |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 7 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 8 | # Copy files |
9 | COPY rw_core ./rw_core | ||||
10 | COPY afrouter ./afrouter | ||||
11 | COPY arouterd ./arouterd | ||||
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 12 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 13 | # Copy config |
14 | RUN cp afrouter/arouter.json /build | ||||
15 | |||||
16 | # Build | ||||
17 | RUN cd arouterd && go build -o /build/arouterd | ||||
18 | |||||
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 19 | |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 20 | # ------------- |
21 | # Image creation stage | ||||
22 | |||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 23 | FROM alpine:3.9 |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 24 | |
25 | # Set the working directory | ||||
26 | WORKDIR /app | ||||
27 | |||||
28 | # Copy required files | ||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 29 | COPY --from=build-env /build/arouterd /app/ |
30 | COPY --from=build-env /build/arouter.json /app/ | ||||
31 |