Open ahalma opened 4 years ago
A step in the right direction is
# Sign up for a key here: https://www.maxmind.com/en/geolite2/signup,
# then generate a license key when logged in
ARG geolib_key="xxx"
# Uncomment in case of premium library usage
#COPY ./GeoIP2-City.mmdb $geolib_path/$geolib_filename
# Using GeoIP Lite version
RUN if [ ! -f $geolib_path/$geolib_filename ]; then \
apk add --no-cache tar && \
mkdir -p $geolib_path && \
wget -q -O - https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=$geolib_key | \
tar \
--strip-components=1 \
-C $geolib_path/ \
-xzvf - && \
mv $geolib_path/GeoLite2-City.mmdb $geolib_path/$geolib_filename; \
fi
Running into other issues now....
Step 7/15 : RUN if [ ! -f $geolib_path/$geolib_filename ]; then apk add --no-cache tar && mkdir -p $geolib_path && wget -q -O - https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=$geolib_key | tar --strip-components=1 -C $geolib_path/ -xzvf - && mv $geolib_path/GeoLite2-City.mmdb $geolib_path/$geolib_filename; fi
---> Running in cc2beaa33085
tar: can't change directory to '/usr/local/share/GeoIP/': No such file or directory
@ahalma Thank you for your help! I'll add these changes to repo when I'll have some spare time :)
Because I kept having trouble with downloading the tar.gz (one time link via maxmind.com?), I went for installing a local copy of the database instead of retrieving it for now (as you suggested in the comments)...
COPY GeoIP2-City.mmdb $geolib_path/$geolib_filename
You can disable GeoIP module by commenting out or modifying some lines.
# RUN if [ ! -f $geolib_path/$geolib_filename ]; then \
# mkdir -p $geolib_path/ && \
# wget -q -O - http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz | \
# tar \
# --strip-components=1 \
# -C $geolib_path/ \
# -xzvf - && \
# mv $geolib_path/GeoLite2-City.mmdb $geolib_path/$geolib_filename; \
# fi
RUN apk update && \
apk add -u $runtime_deps $build_deps && \
git clone https://github.com/allinurl/goaccess -b v1.4 /goaccess && \
cd /goaccess && \
autoreconf -fiv && \
./configure --enable-utf8 && \
make && \
make install && \
apk del $build_deps && \
rm -rf /var/cache/apk/* /tmp/goaccess/* /goaccess
# enable-panel GEO_LOCATION
ignore-panel GEO_LOCATION
# geoip-database /usr/local/share/GeoIP/GeoCity.dat
And, run compose
docker compose up
Building the image fails. GeoLite2-City is no longer available via the path used...
For the reasons of not having this data available, see: https://dev.maxmind.com/geoip/geoip2/geolite2/
In short: