blob: 86cf34819261c217318764340347e6ed2bdf6f4f [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
30RUN go build -mod=vendor -o /go/bin/openolt-scale-tester
31
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/