blob: 1755af199b82897fb64382ef688a21f395f67a83 [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
Stephane Barbarie260a5632019-02-26 16:12:49 -050029RUN go get google.golang.org/genproto/googleapis/api/annotations
sslobodra3ea7d42019-01-16 15:03:16 -050030RUN sh /src/protos/build_protos.sh /src/protos
31
32# Build rw_core
33RUN cd arouterd && go build -o /src/arouterd
34
sslobodra3ea7d42019-01-16 15:03:16 -050035# -------------
36# Image creation stage
37
38FROM alpine:3.6
39
40# Set the working directory
41WORKDIR /app
42
43# Copy required files
44COPY --from=build-env /src/arouterd /app/