icamys / docker-goaccess-nginx

9 stars 4 forks source link

Build fails, GeoLite2-City no longer available #3

Open ahalma opened 4 years ago

ahalma commented 4 years ago

Building the image fails. GeoLite2-City is no longer available via the path used...

Step 6/14 : 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
 ---> Running in 565aa1cdf7f8
wget: bad address 'geolite.maxmind.com'
tar: invalid magic
tar: short read

For the reasons of not having this data available, see: https://dev.maxmind.com/geoip/geoip2/geolite2/

In short:

Due to upcoming data privacy regulations, we are making significant changes to how you access free GeoLite2 databases starting December 30, 2019. Learn more on our blog.

ahalma commented 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
icamys commented 4 years ago

@ahalma Thank you for your help! I'll add these changes to repo when I'll have some spare time :)

ahalma commented 4 years ago

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
loopback-kr commented 1 year ago

You can disable GeoIP module by commenting out or modifying some lines.

And, run compose

docker compose up