blob: ad9571349a416db73893b58d8143a82d07dbef0f [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
6
sslobodra3ea7d42019-01-16 15:03:16 -05007# Copy files
8ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
9ADD common $GOPATH/src/github.com/opencord/voltha-go/common
10ADD db $GOPATH/src/github.com/opencord/voltha-go/db
11ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
sslobodra3ea7d42019-01-16 15:03:16 -050012ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
13ADD arouterd $GOPATH/src/github.com/opencord/voltha-go/arouterd
sslobodra3ea7d42019-01-16 15:03:16 -050014
15
16# Copy required proto files
17# ... VOLTHA proos
sslobodr2fb98b82019-01-21 09:29:51 -050018# Repeate here even if done in base file
sslobodra3ea7d42019-01-16 15:03:16 -050019ADD protos/*.proto /src/protos/
20ADD protos/scripts/* /src/protos/
21ADD afrouter/arouter.json /src
22
23#
24# Copy generated executables here
25WORKDIR $GOPATH/src/github.com/opencord/voltha-go
sslobodra3ea7d42019-01-16 15:03:16 -050026
27# Compile protobuf files
sslobodr2fb98b82019-01-21 09:29:51 -050028# Repeate here even if done in base file
sslobodra3ea7d42019-01-16 15:03:16 -050029RUN sh /src/protos/build_protos.sh /src/protos
30
31# Build rw_core
32RUN cd arouterd && go build -o /src/arouterd
33
sslobodra3ea7d42019-01-16 15:03:16 -050034# -------------
35# Image creation stage
36
37FROM alpine:3.6
38
39# Set the working directory
40WORKDIR /app
41
42# Copy required files
43COPY --from=build-env /src/arouterd /app/