khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [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 | d2b6df9 | 2018-12-13 16:37:20 -0500 | [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 | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 8 | # Copy files |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 9 | COPY adapters/simulated_onu ./adapters/simulated_onu |
10 | COPY adapters/common ./adapters/common | ||||
11 | COPY adapters/*.go ./adapters/ | ||||
khenaidoo | ffe076b | 2019-01-15 16:08:08 -0500 | [diff] [blame] | 12 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 13 | # Build |
14 | RUN cd adapters/simulated_onu && go build -o /build/simulated_onu | ||||
15 | |||||
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 16 | |
17 | # ------------- | ||||
18 | # Image creation stage | ||||
19 | |||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 20 | FROM alpine:3.9 |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 21 | |
22 | # Set the working directory | ||||
23 | WORKDIR /app | ||||
24 | |||||
25 | # Copy required files | ||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 26 | COPY --from=build-env /build/simulated_onu /app/ |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 27 |