| 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 |
| RUN go build -o /src/openolt |
| # Set the working directory |
| COPY --from=build-env /src/openolt /app/ |