blob: 93f4b77d31d861dd8513b15f3ca0a66067dfa068 [file] [log] [blame]
onkarkundargi72cfd362020-02-27 12:34:37 +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
Scott Bakerf04b6392020-03-20 08:29:46 -070018FROM golang:1.13.8-alpine3.11 AS build-env
onkarkundargi72cfd362020-02-27 12:34:37 +053019
20# Install required packages
21RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
22
Scott Bakerf04b6392020-03-20 08:29:46 -070023WORKDIR /go/src
onkarkundargi72cfd362020-02-27 12:34:37 +053024
25COPY . ./
26
27ARG org_label_schema_version=unknown
28ARG org_label_schema_vcs_url=unknown
29ARG org_label_schema_vcs_ref=unknown
30ARG org_label_schema_build_date=unknown
31ARG org_opencord_vcs_commit_date=unknown
32ARG org_opencord_vcs_dirty=unknown
33
34# Build nem-proxy
35SHELL ["/bin/ash", "-o", "pipefail", "-c"]
Scott Bakerf04b6392020-03-20 08:29:46 -070036RUN go build -mod=vendor -o /build/nem-proxy cmd/nem-ondemand-proxy/main.go
onkarkundargi72cfd362020-02-27 12:34:37 +053037# -------------
38# Image creation stage
39
40FROM alpine:3.9.4
41
42# Set the working directory
43WORKDIR /app
44
45# Copy required files
46COPY --from=build-env /build/nem-proxy /app/
47
48# Label image
49ARG org_label_schema_version=unknown
50ARG org_label_schema_vcs_url=unknown
51ARG org_label_schema_vcs_ref=unknown
52ARG org_label_schema_build_date=unknown
53ARG org_opencord_vcs_commit_date=unknown
54ARG org_opencord_vcs_dirty=unknown
55
56LABEL org.label-schema.schema-version=1.0 \
57 org.label-schema.name=nem-proxy \
58 org.label-schema.version=$org_label_schema_version \
59 org.label-schema.vcs-url=$org_label_schema_vcs_url \
60 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
61 org.label-schema.build-date=$org_label_schema_build_date \
62 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
63 org.opencord.vcs-dirty=$org_opencord_vcs_dirty
64
65CMD /app/nem-proxy