aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile
diff options
context:
space:
mode:
authorRajamohan Raj <rajamohan.raj@intel.com>2019-10-15 00:48:18 +0000
committerMarco Platania <platania@research.att.com>2019-10-15 13:30:04 +0000
commit99f7370360201104ddfc99b5e766b4e32e8524cc (patch)
tree9e7dbc4db186e85afd0654b64bdb4cabdb7b81ab /vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile
parent3289af42fd3af32fd07c565d072c65743249ebce (diff)
HDFSWriter microservice working copy
Issue-ID: ONAPARC-453 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com> Change-Id: I11c91b642e466763c1ca6f5734bf81fb260e2b39
Diffstat (limited to 'vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile')
-rw-r--r--vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile38
1 files changed, 38 insertions, 0 deletions
diff --git a/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile
new file mode 100644
index 00000000..ee476717
--- /dev/null
+++ b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/Dockerfile
@@ -0,0 +1,38 @@
+# Use base golang image from Docker Hub
+FROM golang:1.12.7
+
+# Download the dlv (delve) debugger for go (you can comment this out if unused)
+RUN go get -u github.com/go-delve/delve/cmd/dlv
+
+WORKDIR /src/hdfs-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 /hdfs-writer -v ./cmd/hdfs-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. (Note that the
+# application process will NOT start until the debugger is attached.)
+#ENTRYPOINT ["dlv", "debug", "./cmd/hdfs-writer", "--api-version=2", "--headless", "--listen=:3001", "--log", "--log-dest=/home.dlv.log"]
+
+# If you want to run WITHOUT the debugging server:
+# * COMMENT OUT the previous ENTRYPOINT statements,
+# * UNCOMMENT the following ENTRYPOINT statement.
+#ENTRYPOINT ["/bin/sleep", "3600"]
+ENTRYPOINT ["/hdfs-writer"] \ No newline at end of file