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_olt ./adapters/simulated_olt |
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_olt && go build -o /build/simulated_olt | ||||
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 | # Set the working directory |
22 | WORKDIR /app | ||||
23 | |||||
24 | # Copy required files | ||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame^] | 25 | COPY --from=build-env /build/simulated_olt /app/ |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 26 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame^] | 27 | ENTRYPOINT ["/app/simulated_olt"] |