blob: 659d78ba2ba9d5bd75578138a0f7ee484833bf34 [file] [log] [blame]
sslobodra3ea7d42019-01-16 15:03:16 -05001# -------------
2# Build stage
3
sslobodr2fb98b82019-01-21 09:29:51 -05004FROM base AS build-env
sslobodra3ea7d42019-01-16 15:03:16 -05005
sslobodra3ea7d42019-01-16 15:03:16 -05006WORKDIR $GOPATH/src/github.com/opencord/voltha-go
7
Matt Jeanneret85ab5082019-04-01 11:29:20 -04008# Copy files
9COPY rw_core ./rw_core
10COPY afrouter ./afrouter
11
12# Copy config and runtime protobuf needed for routing
13RUN cp afrouter/arouter.json /build
14RUN cp vendor/github.com/opencord/voltha-protos/go/voltha.pb /build
15
16# Build
17RUN cd afrouter && go build -o /build/afrouter
18
sslobodra3ea7d42019-01-16 15:03:16 -050019
sslobodra3ea7d42019-01-16 15:03:16 -050020# -------------
21# Image creation stage
22
Matt Jeanneret85ab5082019-04-01 11:29:20 -040023FROM alpine:3.9
sslobodra3ea7d42019-01-16 15:03:16 -050024
25# Set the working directory
26WORKDIR /app
27
28# Copy required files
Matt Jeanneret85ab5082019-04-01 11:29:20 -040029COPY --from=build-env /build/afrouter /app/
30COPY --from=build-env /build/arouter.json /app/
31COPY --from=build-env /build/voltha.pb /app
sslobodra3ea7d42019-01-16 15:03:16 -050032