HDFS-WriterApp-Fixed all the code review comments
[demo.git] / vnfs / DAaaS / microservices / GoApps / src / go-hdfs-writer / Dockerfile
1 # Use base golang image from Docker Hub
2 FROM golang:1.12.7
3
4 # Download the dlv (delve) debugger for go (you can comment this out if unused)
5 RUN go get -u github.com/go-delve/delve/cmd/dlv
6
7 WORKDIR /src/hdfs-writer
8
9 RUN mkdir /librdkafka-dir && cd /librdkafka-dir
10 RUN git clone https://github.com/edenhill/librdkafka.git && \
11 cd librdkafka && \
12 ./configure --prefix /usr && \
13 make && \
14 make install
15
16 # Install dependencies in go.mod and go.sum
17 COPY go.mod go.sum ./
18 RUN go mod download
19
20 # Copy rest of the application source code
21 COPY . ./
22
23 # Compile the application to /app.
24 RUN go build -o /hdfs-writer -v ./cmd/hdfs-writer
25
26 # If you want to use the debugger, you need to modify the entrypoint to the
27 # container and point it to the "dlv debug" command:
28 #   * UNCOMMENT the following ENTRYPOINT statement,
29 #   * COMMENT OUT the last ENTRYPOINT statement
30 # Start the "dlv debug" server on port 3000 of the container. (Note that the
31 # application process will NOT start until the debugger is attached.)
32 #ENTRYPOINT ["dlv", "debug", "./cmd/hdfs-writer",  "--api-version=2", "--headless", "--listen=:3001", "--log", "--log-dest=/home.dlv.log"]
33
34 # If you want to run WITHOUT the debugging server:
35 #   * COMMENT OUT the previous ENTRYPOINT statements,
36 #   * UNCOMMENT the following ENTRYPOINT statement.
37 #ENTRYPOINT ["/bin/sleep", "3600"]
38 ENTRYPOINT ["/hdfs-writer"]