blob: 96d3c5b4ec88a04c37ae657d64b1750f66f8c071 [file] [log] [blame]
Girish Gowdra64503432020-01-07 10:59:10 +05301# Copyright 2016 the original author or authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# -------------
16# Build stage
17
18FROM golang:1.12-alpine3.9 AS build-env
19
20# Install required packages
21RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
22
23# Prepare directory structure
24WORKDIR /go/src
25COPY . .
26
27# Build openolt
28SHELL ["/bin/ash", "-o", "pipefail", "-c"]
29ENV GO111MODULE=on
Girish Gowdra55444792020-03-26 13:43:18 -070030RUN go mod vendor && go build -mod=vendor && go build -mod=vendor -o /go/bin/openolt-scale-tester
Girish Gowdra64503432020-01-07 10:59:10 +053031
32# -------------
33# Image creation stage
34
35FROM alpine:3.9.4
36
37# Set the working directory
38WORKDIR /app
39
40# Copy required files
41COPY --from=build-env /go/bin/openolt-scale-tester /app/
42COPY --from=build-env /go/src/tech-profiles /app/