khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 1 | # ------------- |
2 | # Build stage | ||||
3 | |||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 4 | FROM base AS build-env |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 5 | |
khenaidoo | ffe076b | 2019-01-15 16:08:08 -0500 | [diff] [blame] | 6 | WORKDIR $GOPATH/src/github.com/opencord/voltha-go |
7 | |||||
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 8 | # Copy files |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 9 | COPY rw_core ./rw_core |
khenaidoo | ffe076b | 2019-01-15 16:08:08 -0500 | [diff] [blame] | 10 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 11 | # Build |
12 | RUN cd rw_core && go build -o /build/rw_core | ||||
13 | |||||
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 14 | |
15 | # ------------- | ||||
16 | # Image creation stage | ||||
17 | |||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 18 | FROM alpine:3.9 |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 19 | |
20 | # Set the working directory | ||||
21 | WORKDIR /app | ||||
22 | |||||
23 | # Copy required files | ||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 24 | COPY --from=build-env /build/rw_core /app/ |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 25 |