Skip to content

6RUN0/docker-geoipupdate

Repository files navigation

GeoIP Update Docker Image

This Docker image builds and runs geoipupdate — a utility provided by MaxMind to automatically fetch and update GeoIP2 and GeoLite2 databases.

Features

  • Based on alpine image
  • Builds from the MaxMind GitHub repository
  • Applies patch to remove manpage generation
  • Uses supercronic to schedule periodic updates (every 12 hours)
  • Designed to run as a non-root user
  • Entrypoint script automatically generates configuration based on environment variables

Usage

You must provide valid MaxMind credentials (Account ID and License Key) to download databases. This can be done via environment variables.

Basic docker run Example

docker run -d \
  -e MAXMIND_ACCOUNT_ID=YOUR_ACCOUNT_ID \
  -e MAXMIND_LICENSE_KEY=YOUR_LICENSE_KEY \
  -e MAXMIND_EDITION_IDS="GeoLite2-City GeoLite2-Country" \
  -v $(pwd)/data:/data \
  6run0/geoipupdate

This will:

  • Write updated databases to the ./data directory on your host.
  • Update them every 12 hours using a cron job.

Configuration

The container entrypoint dynamically creates a `GeoIP.conf`` file using the following environment variables:

Variable Name Description Required Default
MAXMIND_ACCOUNT_ID Your MaxMind account ID ✅ Yes
MAXMIND_LICENSE_KEY Your MaxMind license key ✅ Yes
MAXMIND_EDITION_IDS Space-separated list of edition IDs to download ❌ No GeoLite2-Country GeoLite2-City
MAXMIND_PROXY Proxy server URL (e.g., http://proxy.example.com:8080) ❌ No
MAXMIND_PROXY_USER_PASSWORD Credentials for proxy authentication (e.g., user:pass) ❌ No

These are written to /etc/GeoIP.conf, which geoipupdate uses.

Scheduled Updates

The following cron job is configured using supercronic:

0 */12 * * * geoipupdate -v

You can override this by mounting your own crontab file to /etc/supercronic.

Volumes

The container uses the following volume:

  • /data: Output directory for downloaded databases

Entrypoint

The default ENTRYPOINT is:

tini -- /docker-entrypoint.sh

It ensures:

  • Safe signal handling via tini
  • Configuration is generated before supercronic is started

Building the Image

If you want to build the image locally:

docker build -t geoipupdate .

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published