blob: 329fc6838e39a6c2c96c4832e3374355ada5d694 [file] [log] [blame]
# -------------
# Build stage
FROM base AS build-env
# Copy files
ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
ADD common $GOPATH/src/github.com/opencord/voltha-go/common
ADD db $GOPATH/src/github.com/opencord/voltha-go/db
ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
# Copy required proto files
# ... VOLTHA proos
# Repeat here even if it's done in the base
ADD afrouter/arouter.json /src
COPY vendor/github.com/opencord/voltha-protos/go/voltha.pb /src
#
# Copy generated executables here
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
# Build rw_core
RUN cd afrouter && go build -o /src/afrouter
# -------------
# Image creation stage
FROM alpine:3.6
# Set the working directory
WORKDIR /app
# Copy required files
COPY --from=build-env /src/afrouter /app/
COPY --from=build-env /src/arouter.json /app/
COPY --from=build-env /src/voltha.pb /app/
WORKDIR config
WORKDIR /app
#CMD cd /app && ./arouter -config config/arouter.voltha2.json
# Set the config volume