This Docker image builds and runs geoipupdate —
a utility provided by MaxMind to automatically fetch
and update GeoIP2 and GeoLite2 databases.
- Based on
alpineimage - Builds from the MaxMind GitHub repository
- Applies patch to remove manpage generation
- Uses
supercronicto schedule periodic updates (every 12 hours) - Designed to run as a non-root user
- Entrypoint script automatically generates configuration based on environment variables
You must provide valid MaxMind credentials (Account ID and License Key)
to download databases. This can be done via environment variables.
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/geoipupdateThis will:
- Write updated databases to the
./datadirectory on your host. - Update them every 12 hours using a cron job.
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.
The following cron job is configured using supercronic:
0 */12 * * * geoipupdate -vYou can override this by mounting your own crontab file to /etc/supercronic.
The container uses the following volume:
/data: Output directory for downloaded databases
The default ENTRYPOINT is:
tini -- /docker-entrypoint.shIt ensures:
- Safe signal handling via
tini - Configuration is generated before
supercronicis started
If you want to build the image locally:
docker build -t geoipupdate .