blob: 2d5f139080118e53a33571593cee06d7adf9e6e3 [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
sslobodra3ea7d42019-01-16 15:03:16 -05007
Matt Jeanneret85ab5082019-04-01 11:29:20 -04008# Copy files
9COPY rw_core ./rw_core
10COPY afrouter ./afrouter
11COPY arouterd ./arouterd
sslobodra3ea7d42019-01-16 15:03:16 -050012
Matt Jeanneret85ab5082019-04-01 11:29:20 -040013# Copy config
14RUN cp afrouter/arouter.json /build
15
16# Build
17RUN cd arouterd && go build -o /build/arouterd
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/arouterd /app/
30COPY --from=build-env /build/arouter.json /app/
31
32ENTRYPOINT ["/app/arouterd"]