blob: b1769a19345866b8a40b0a14725d10f63bb65617 [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# Copy files
7ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
8ADD common $GOPATH/src/github.com/opencord/voltha-go/common
9ADD db $GOPATH/src/github.com/opencord/voltha-go/db
10ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
sslobodra3ea7d42019-01-16 15:03:16 -050011ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
12
sslobodra3ea7d42019-01-16 15:03:16 -050013# Copy required proto files
14# ... VOLTHA proos
sslobodr2fb98b82019-01-21 09:29:51 -050015# Repeat here even if it's done in the base
sslobodra3ea7d42019-01-16 15:03:16 -050016ADD protos/*.proto /src/protos/
17ADD protos/scripts/* /src/protos/
18ADD afrouter/arouter.json /src
19
20#
21# Copy generated executables here
22WORKDIR $GOPATH/src/github.com/opencord/voltha-go
23
sslobodra3ea7d42019-01-16 15:03:16 -050024# Compile protobuf files
sslobodr2fb98b82019-01-21 09:29:51 -050025# Repeat here even if it's done in the base
sslobodra3ea7d42019-01-16 15:03:16 -050026RUN sh /src/protos/build_protos.sh /src/protos
27
28# Build rw_core
29RUN cd afrouter && go build -o /src/afrouter
30
sslobodra3ea7d42019-01-16 15:03:16 -050031# -------------
32# Image creation stage
33
34FROM alpine:3.6
35
36# Set the working directory
37WORKDIR /app
38
39# Copy required files
40COPY --from=build-env /src/afrouter /app/
41COPY --from=build-env /src/arouter.json /app/
42COPY --from=build-env /src/protos/voltha.pb /app/
43WORKDIR config
44WORKDIR /app
45
46#CMD cd /app && ./arouter -config config/arouter.voltha2.json
47
48# Set the config volume
49