blob: 0e20b444659ff29adb58cb1ded17d1640f508d78 [file] [log] [blame]
# -------------
# Build stage
FROM golang:1.10-alpine3.9 AS build-env
# Install required packages
RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
# Prepare directory structure
RUN ["mkdir", "-p", "/src"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord"]
RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-openolt-adapter"]
WORKDIR $GOPATH/src/github.com/opencord/voltha-openolt-adapter
COPY adaptercore ./adaptercore
COPY config ./config
COPY vendor ./vendor
COPY *.go ./
# Build openolt
RUN go build -o /src/openolt
# -------------
# Image creation stage
FROM alpine:3.9
# Set the working directory
WORKDIR /app
# Copy required files
COPY --from=build-env /src/openolt /app/