summaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2019-10-31 15:46:37 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2019-11-11 14:39:44 -0800
commitd11cb99fb101a6798fd57fa44d332737d6637e75 (patch)
tree0d7ae93ac67186a9bd4dd81db85eab9ccd64334f /vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci
parent68d118176bb53c36b31a7060cfa16ad5acac1765 (diff)
Prometheus Kafka Writer Microservice
This patch implents Prometheus to remote Kafka Writer Microservice Added sample day-2 config to configure prometheus PS4: Fixed Review comments Issue-ID: ONAPARC-393 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com> Change-Id: I0bc77175593a165effd7bb1cb4802c988a5ef4ec
Diffstat (limited to 'vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci')
-rw-r--r--vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci43
1 files changed, 43 insertions, 0 deletions
diff --git a/vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci b/vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci
new file mode 100644
index 00000000..a135dbbd
--- /dev/null
+++ b/vnfs/DAaaS/microservices/prom-kafka-writer/Dockerfile.ci
@@ -0,0 +1,43 @@
+# Use base golang image from Docker Hub
+FROM golang:1.12.7 as builder
+
+# Download the dlv (delve) debugger for go (you can comment this out if unused)
+RUN go get -u -v github.com/go-delve/delve/cmd/dlv
+
+WORKDIR /src/prom-kafka-writer
+
+RUN mkdir /librdkafka-dir && cd /librdkafka-dir
+RUN git clone https://github.com/edenhill/librdkafka.git && \
+cd librdkafka && \
+./configure --prefix /usr && \
+make && \
+make install
+
+# Install dependencies in go.mod and go.sum
+COPY go.mod go.sum ./
+RUN go mod download
+
+# Copy rest of the application source code
+COPY . ./
+
+# Compile the application to /app.
+RUN go build -o ./bin/prom-kafka-writer -v ./cmd/prom-kafka-writer
+
+# If you want to use the debugger, you need to modify the entrypoint to the
+# container and point it to the "dlv debug" command:
+# * UNCOMMENT the following ENTRYPOINT statement,
+# * COMMENT OUT the last ENTRYPOINT statement
+# Start the "dlv debug" server on port 3000 of the container.
+#ENTRYPOINT ["dlv", "exec", "./bin/prom-kafka-writer", "--continue", "--accept-multiclient", "--api-version=2", "--headless", "--listen=:3000", "--log"]
+
+# If you want to run WITHOUT the debugging server:
+# * COMMENT OUT the previous ENTRYPOINT statements,
+# * UNCOMMENT the following ENTRYPOINT statement.
+
+# final stage
+FROM ubuntu:18.04
+COPY --from=builder /usr/lib/pkgconfig /usr/lib/pkgconfig
+COPY --from=builder /usr/lib/librdkafka* /usr/lib/
+COPY --from=builder //src/prom-kafka-writer/* /prom-kafka-writer/
+WORKDIR /prom-kafka-writer
+ENTRYPOINT ["./bin/prom-kafka-writer"]