-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerFile
85 lines (54 loc) · 2.88 KB
/
DockerFile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# new docker image base on ubuntu 20.04 Image
FROM ubuntu:focal
ENV NFC_DEBUG="true"
# Total number of used cpu - added in 0.0.1.23-beta
# set it 0 to use all available CPUs
ENV NFC_CPU_NUM="1"
ENV NFC_LISTEN_ADDRESS="0.0.0.0"
ENV NFC_LISTEN_PORT="6859"
ENV NFC_LOG_FILE="/opt/nfcollector/var/log/collector.log"
ENV NFC_INFLUXDB_HOST="127.0.0.1"
ENV NFC_INFLUX_PORT="8086"
ENV NFC_INFLUXDB_TOKEN="JAD5kZ0n3GAQ3jdpe17NT5_NUg73GOvdjZjhxOMiJMx1cZyvLz-4DuR7K8xyRGlPcNQXLqrUTY20lWqbRiK--w=="
ENV NFC_INFLUXDB_BUCKET="nfCollector"
ENV NFC_INFLUXDB_ORG="MJMOHEBBI"
ENV NFC_IP_REPTATION_IPSUM="/opt/nfcollector/vendors/ipsum/ipsum.txt"
ENV NFC_IP2L_ASN="/opt/nfcollector/vendors/ip2location/db/IP2LOCATION-LITE-ASN.IPV6.CSV/IP2LOCATION-LITE-ASN.IPV6.CSV"
ENV NFC_IP2L_IP="/opt/nfcollector/vendors/ip2location/db/IP2LOCATION-LITE-DB11.IPV6.BIN/IP2LOCATION-LITE-DB11.IPV6.BIN"
ENV NFC_IP2L_PROXY="/opt/nfcollector/vendors/ip2location/db/IP2PROXY-LITE-PX10.IPV6.CSV/IP2PROXY-LITE-PX10.IPV6.CSV"
ENV NFC_IP2L_LOCAL="/opt/nfcollector/vendors/ip2location/local-db/local.csv"
# creating needed directories
RUN mkdir -pv /opt/nfcollector/vendors/ip2location/db
RUN mkdir -pv /opt/nfcollector/vendors/ip2location/local-db
RUN mkdir -pv /opt/nfcollector/vendors/ipsum
RUN mkdir -pv /opt/nfcollector/var/log
RUN mkdir -pv /opt/nfcollector/etc
RUN mkdir -pv /opt/nfcollector/bin
# copy executable file
COPY ./build/linux/amd64/nfcollector /opt/nfcollector/bin/nfcollector
COPY ./build/linux/amd64/nfupdater /opt/nfcollector/bin/nfupdater
# # copy templates/
COPY ./templates/configs-example/*.yml /opt/nfcollector/etc/
# allow nfcollector to run
RUN chmod +x /opt/nfcollector/bin/nfcollector
# allow nfupdater to run
RUN chmod +x /opt/nfcollector/bin/nfupdater
# prepare apt-get
RUN apt-get update && apt-get install apt-utils -y && apt-get install unzip -y
# wget installation
RUN apt-get install wget -y
# download ip2location db
RUN wget https://download.openintelligence24.com/vendors/ip2location/IP2LOCATION-LITE-ASN.IPV6.CSV.ZIP \
&& wget https://download.openintelligence24.com/vendors/ip2location/IP2LOCATION-LITE-DB11.IPV6.BIN.ZIP \
&& wget https://download.openintelligence24.com/vendors/ip2location/IP2PROXY-LITE-PX10.IPV6.CSV.ZIP
# extract them
RUN unzip IP2LOCATION-LITE-DB11.IPV6.BIN.ZIP -d /opt/nfcollector/vendors/ip2location/db/IP2LOCATION-LITE-DB11.IPV6.BIN/ \
&& unzip IP2PROXY-LITE-PX10.IPV6.CSV.ZIP -d /opt/nfcollector/vendors/ip2location/db/IP2PROXY-LITE-PX10.IPV6.CSV/ \
&& unzip IP2LOCATION-LITE-ASN.IPV6.CSV.ZIP -d /opt/nfcollector/vendors/ip2location/db/IP2LOCATION-LITE-ASN.IPV6.CSV/
# download ipsum db
RUN wget https://download.openintelligence24.com/vendors/ipsum/ipsum.txt
RUN mv ./ipsum.txt /opt/nfcollector/vendors/ipsum/ipsum.txt -v
# RUN cat /opt/nfcollector/etc/collector.yml
# RUN cat /opt/nfcollector/etc/ip2location.yml
# run the command
CMD [ "/opt/nfcollector/bin/nfcollector" ]