1 # Use base golang image from Docker Hub
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
7 WORKDIR /src/hdfs-writer
9 RUN mkdir /librdkafka-dir && cd /librdkafka-dir
10 RUN git clone https://github.com/edenhill/librdkafka.git && \
12 ./configure --prefix /usr && \
16 # Install dependencies in go.mod and go.sum
20 # Copy rest of the application source code
23 # Compile the application to /app.
24 RUN go build -o /hdfs-writer -v ./cmd/hdfs-writer
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"]
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"]