
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
A simple and efficient Go-based HTTP service that provides geolocation information for IP addresses using the MaxMind GeoLite2-City database.
The ip-lookup Docker container expects the GeoLite2 database to be available at /geoipdb/GeoLite2-City.mmdb by default. This path is configurable via the GEOIP_DB_PATH environment variable if needed.
The recommended way to run this service with Docker is by using docker-compose along with MaxMind's official geoipupdate container. This automates the download and periodic refresh of the GeoLite2 database, which the ip-lookup service will then use.
Here’s how to set it up:
Create a docker-compose.yml file:
yamlversion: "3.8" services: geoipupdate: container_name: geoipupdate image: ghcr.io/maxmind/geoipupdate restart: unless-stopped environment: # Replace with your actual MaxMind account ID and license key - GEOIPUPDATE_ACCOUNT_ID=YOUR_ACCOUNT_ID - GEOIPUPDATE_LICENSE_KEY=YOUR_LICENSE_KEY - GEOIPUPDATE_EDITION_IDS=GeoLite2-City # We only need the City database - GEOIPUPDATE_FREQUENCY=72 # How often to check for updates (in hours) volumes: - geoip_data:/usr/share/GeoIP # geoipupdate writes here ip-lookup: container_name: ip-lookup image: issaali/ip-lookup:latest # Or a specific version restart: unless-stopped depends_on: - geoipupdate ports: - "8080:8080" # Map host port 8080 to container port 8080 volumes: - geoip_data:/geoipdb # ip-lookup reads from here environment: # GEOIP_DB_PATH is already set to /geoipdb/GeoLite2-City.mmdb in the Dockerfile # LISTEN_ADDR can be overridden here if needed, e.g., - LISTEN_ADDR=:9000 - LISTEN_ADDR=:8080 # ALLOWED_CORS_ORIGINS can be set here to configure allowed origins for CORS # Example: - ALLOWED_CORS_ORIGINS=http://localhost:3000,https://your.frontend.app # Example to allow all: - ALLOWED_CORS_ORIGINS=* # Add healthcheck if desired # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"] # interval: 30s # timeout: 10s # retries: 3 volumes: geoip_data: # This named volume is shared between the two services driver: local
Sign up for a MaxMind Account:
You need a MaxMind account and a license key to use geoipupdate. You can typically get these from the https://www.maxmind.com/en/geolite2/signup. The free GeoLite2 databases require account signup.
Configure Environment Variables:
Replace YOUR_ACCOUNT_ID and YOUR_LICENSE_KEY in the docker-compose.yml file with your actual MaxMind credentials. Alternatively, you can use a .env file in the same directory as your docker-compose.yml:
envGEOIPUPDATE_ACCOUNT_ID=YOUR_ACCOUNT_ID GEOIPUPDATE_LICENSE_KEY=YOUR_LICENSE_KEY
And then reference them in docker-compose.yml:
yaml# ... inside geoipupdate service environment: - GEOIPUPDATE_ACCOUNT_ID=${GEOIPUPDATE_ACCOUNT_ID} - GEOIPUPDATE_LICENSE_KEY=${GEOIPUPDATE_LICENSE_KEY} # ...
Run Docker Compose:
bashdocker-compose up -d
This will start both services. The geoipupdate service will download the GeoLite2-City.mmdb into the shared geoip_data volume, and ip-lookup will read it from there.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务