Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame^] | 1 | # 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 . |
| 16 | # docker build -t 10.90.0.101:30500/opencord/kafka-topic-exporter:latest . |
| 17 | |
Matteo Scandolo | 189526a | 2018-07-13 09:10:23 -0700 | [diff] [blame] | 18 | FROM golang:latest as builder |
| 19 | RUN mkdir /app |
| 20 | ADD . /app/ |
| 21 | WORKDIR /app |
| 22 | RUN go get github.com/prometheus/client_golang/prometheus |
| 23 | RUN go get github.com/Shopify/sarama |
| 24 | RUN CGO_ENABLED=0 GOOS=linux go build -o main . |
| 25 | |
| 26 | FROM alpine:latest |
| 27 | WORKDIR /app/ |
| 28 | COPY --from=builder /app/main . |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame^] | 29 | ENTRYPOINT ["./main"] |