Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -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 |
Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -0500 | [diff] [blame] | 5 | |
6 | WORKDIR $GOPATH/src/github.com/opencord/voltha-go | ||||
7 | |||||
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 8 | # Copy files. |
9 | COPY ro_core ./ro_core | ||||
Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -0500 | [diff] [blame] | 10 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 11 | # Build |
12 | RUN cd ro_core && go build -o /build/ro_core | ||||
13 | |||||
Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -0500 | [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 |
Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -0500 | [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/ro_core /app/ |
Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -0500 | [diff] [blame] | 25 | |
Matt Jeanneret | 85ab508 | 2019-04-01 11:29:20 -0400 | [diff] [blame] | 26 | ENTRYPOINT ["/app/ro_core"] |