blob: 302c7b656ce3992729aadacc036842b1ac4ca017 [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
sslobodr1d1e50b2019-03-14 09:17:40 -040030#RUN find / -name "*.pb.go" -print
sslobodrd6e07e72019-01-31 16:07:20 -050031
32#ADD /src/protos/voltha.pb test/afrouter/suites
33# Build rw_core
34RUN cd afrouter && go build -o /src/afrouter
35#RUN ls -l /src/protos
36RUN cp /src/protos/voltha.pb tests/afrouter/suites
37RUN cd tests/afrouter && go build -o /src/afrouterTest
38RUN mkdir /src/tests
sslobodr1d1e50b2019-03-14 09:17:40 -040039RUN cd tests/afrouter/suites && /src/afrouterTest -config main.json -logLevel 1
sslobodrd6e07e72019-01-31 16:07:20 -050040RUN mkdir /src/temp
41RUN cp -r tests/afrouter/tests /src/temp
42#RUN cd tests/afrouter/tester && go build -o /src/tests
43
44# -------------
45# Image creation stage
46
47FROM alpine:3.6
48
49# Set the working directory
50WORKDIR /app/src
51WORKDIR /app
52
53# Copy required files
54COPY --from=build-env /src/afrouter /app/
55COPY --from=build-env /src/afrouterTest /app/
56COPY --from=build-env /src/arouter.json /app/
57COPY --from=build-env /src/arouter_test.json /app/
58COPY --from=build-env /src/protos/voltha.pb /app/
sslobodr1d1e50b2019-03-14 09:17:40 -040059COPY --from=build-env /src/suites/ /app/suites/
sslobodrd6e07e72019-01-31 16:07:20 -050060COPY --from=build-env /src/tests /app
61COPY --from=build-env /src/temp/ /app/src/
sslobodr1d1e50b2019-03-14 09:17:40 -040062COPY --from=build-env /go/src/github.com/opencord/voltha-go/protos/ /app/protos/
sslobodrd6e07e72019-01-31 16:07:20 -050063WORKDIR /app
64
65#CMD cd /app && ./arouter -config config/arouter.voltha2.json
66
67# Set the config volume
68