blob: ecc99193ded6d45860d91695ae6210da4637b9a1 [file] [log] [blame]
khenaidoocfee5f42018-07-19 22:47:38 -04001# -------------
2# Build stage
3
4FROM golang:alpine AS build-env
5
6# Install required packages
7RUN apk add --no-cache wget git make build-base
8
9# Prepare directory structure
10RUN ["mkdir", "-p", "/src"]
11RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
12
13# Copy files
14ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
15ADD common $GOPATH/src/github.com/opencord/voltha-go/common
16ADD db $GOPATH/src/github.com/opencord/voltha-go/db
17
18# Build rw_core
19RUN cd $GOPATH/src/github.com/opencord/voltha-go/rw_core && go get -d ./... && go build -o /src/rw_core
20
21# -------------
22# Image creation stage
23
24FROM alpine:3.6
25
26# Set the working directory
27WORKDIR /app
28
29# Copy required files
30COPY --from=build-env /src/rw_core /app/
31