forked from AlexeyKupershtokh/clickhouse-maxmind-geoip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (26 loc) · 1.35 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
FROM yandex/clickhouse-server
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
unzip \
&& rm -rf \
/var/lib/apt/lists/* \
/var/cache/debconf \
/tmp/* \
&& apt-get clean
# download MaxMind GeoLite2 databases
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip /tmp
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip /tmp
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip /tmp
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip -O /tmp/GeoLite2-City-CSV.zip --no-check-certificate
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip -O /tmp/GeoLite2-Country-CSV.zip --no-check-certificate
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip -O /tmp/GeoLite2-ASN-CSV.zip --no-check-certificate
RUN unzip /tmp/GeoLite2-City-CSV.zip -d /tmp
RUN unzip /tmp/GeoLite2-Country-CSV.zip -d /tmp
RUN unzip /tmp/GeoLite2-ASN-CSV.zip -d /tmp
RUN mv /tmp/*/* /etc/clickhouse-server/
ADD clickhouse /etc/clickhouse-server
RUN pwd
RUN ls -la
RUN ls -la /etc/clickhouse-server
RUN ls -la /tmp
RUN cat /etc/clickhouse-server/GeoLite2-City-Locations-en.csv | sed 's/'"'"'/\\'"'"'/g' > /etc/clickhouse-server/GeoLite2-City-Locations-en-fixed.csv