blob: d8da92d95a9b4d528c0d6d0a940b291206ea1e70 [file] [log] [blame]
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -07001# Copyright 2018-present Open Networking Foundation
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# docker build -t opencord/kafka-topic-exporter:latest .
kartikey dubey72ef3b82019-05-27 06:50:04 +000016# docker build -t 10.128.22.1:30500/opencord/kafka-topic-exporter:latest .
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070017
Scott Bakere8537af2018-10-22 14:53:44 -070018FROM golang:1.10-stretch as builder
Ganesh Bhure8bb19822019-06-10 10:56:22 +053019RUN mkdir -p /go/src/gerrit.opencord.org/kafka-topic-exporter
Ganesh Bhure8bb19822019-06-10 10:56:22 +053020RUN go get -u github.com/golang/dep/cmd/dep
kartikey dubey72ef3b82019-05-27 06:50:04 +000021ADD Gopkg.lock /go/src/gerrit.opencord.org/kafka-topic-exporter
22ADD Gopkg.toml /go/src/gerrit.opencord.org/kafka-topic-exporter
23WORKDIR /go/src/gerrit.opencord.org/kafka-topic-exporter
Ganesh Bhure8bb19822019-06-10 10:56:22 +053024RUN dep ensure --vendor-only
kartikey dubey72ef3b82019-05-27 06:50:04 +000025ADD . /go/src/gerrit.opencord.org/kafka-topic-exporter
Scott Bakere8537af2018-10-22 14:53:44 -070026RUN CGO_ENABLED=0 GOOS=linux go build -o main .
Matteo Scandolo189526a2018-07-13 09:10:23 -070027
Scott Bakere8537af2018-10-22 14:53:44 -070028FROM alpine:3.8
Ganesh Bhure8bb19822019-06-10 10:56:22 +053029WORKDIR /go/src/gerrit.opencord.org/kafka-topic-exporter/
30COPY --from=builder /go/src/gerrit.opencord.org/kafka-topic-exporter/main .
kartikey dubey72ef3b82019-05-27 06:50:04 +000031# FIXME this should be mounted by the helm charts
32ADD config/conf.yaml /etc/config/conf.yaml
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053033ENTRYPOINT ["./main"]