blob: 5fe1dc231b34b92dd015f676e19099075f15a674 [file] [log] [blame]
sslobodrd6e07e72019-01-31 16:07:20 -05001# -------------
2# Build stage
3
4FROM base AS build-env
5
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
11ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
12ADD tests/afrouter $GOPATH/src/github.com/opencord/voltha-go/tests/afrouter
13
14# Copy required proto files
15# ... VOLTHA proos
16# Repeat here even if it's done in the base
17ADD protos/*.proto /src/protos/
18ADD protos/scripts/* /src/protos/
19ADD afrouter/arouter.json /src/
20ADD tests/afrouter/suites/* /src/suites/
21ADD tests/afrouter/arouter_test.json /src/
22
23#
24# Copy generated executables here
25WORKDIR $GOPATH/src/github.com/opencord/voltha-go
26
27# Compile protobuf files
28# Repeat here even if it's done in the base
29RUN sh /src/protos/build_protos.sh /src/protos
30
31#ADD /src/protos/voltha.pb test/afrouter/suites
32# Build rw_core
33RUN cd afrouter && go build -o /src/afrouter
34#RUN ls -l /src/protos
35RUN cp /src/protos/voltha.pb tests/afrouter/suites
36RUN cd tests/afrouter && go build -o /src/afrouterTest
37RUN mkdir /src/tests
38RUN cd tests/afrouter/suites && /src/afrouterTest -config main.json
39RUN mkdir /src/temp
40RUN cp -r tests/afrouter/tests /src/temp
41#RUN cd tests/afrouter/tester && go build -o /src/tests
42
43# -------------
44# Image creation stage
45
46FROM alpine:3.6
47
48# Set the working directory
49WORKDIR /app/src
50WORKDIR /app
51
52# Copy required files
53COPY --from=build-env /src/afrouter /app/
54COPY --from=build-env /src/afrouterTest /app/
55COPY --from=build-env /src/arouter.json /app/
56COPY --from=build-env /src/arouter_test.json /app/
57COPY --from=build-env /src/protos/voltha.pb /app/
58COPY --from=build-env /src/suites /app
59COPY --from=build-env /src/tests /app
60COPY --from=build-env /src/temp/ /app/src/
61WORKDIR /app
62
63#CMD cd /app && ./arouter -config config/arouter.voltha2.json
64
65# Set the config volume
66