blob: 329fc6838e39a6c2c96c4832e3374355ada5d694 [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
William Kurkiandaa6bb22019-03-07 12:26:28 -050012ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
sslobodra3ea7d42019-01-16 15:03:16 -050013
sslobodra3ea7d42019-01-16 15:03:16 -050014# Copy required proto files
15# ... VOLTHA proos
sslobodr2fb98b82019-01-21 09:29:51 -050016# Repeat here even if it's done in the base
sslobodra3ea7d42019-01-16 15:03:16 -050017ADD afrouter/arouter.json /src
William Kurkiandaa6bb22019-03-07 12:26:28 -050018COPY vendor/github.com/opencord/voltha-protos/go/voltha.pb /src
sslobodra3ea7d42019-01-16 15:03:16 -050019
20#
21# Copy generated executables here
22WORKDIR $GOPATH/src/github.com/opencord/voltha-go
23
sslobodra3ea7d42019-01-16 15:03:16 -050024# Build rw_core
25RUN cd afrouter && go build -o /src/afrouter
26
sslobodra3ea7d42019-01-16 15:03:16 -050027# -------------
28# Image creation stage
29
30FROM alpine:3.6
31
32# Set the working directory
33WORKDIR /app
34
35# Copy required files
36COPY --from=build-env /src/afrouter /app/
37COPY --from=build-env /src/arouter.json /app/
William Kurkiandaa6bb22019-03-07 12:26:28 -050038COPY --from=build-env /src/voltha.pb /app/
sslobodra3ea7d42019-01-16 15:03:16 -050039WORKDIR config
40WORKDIR /app
41
42#CMD cd /app && ./arouter -config config/arouter.voltha2.json
43
44# Set the config volume
45