本站支持搜索的镜像仓库:Docker Hub、gcr.io、ghcr.io、quay.io、k8s.gcr.io、registry.gcr.io、elastic.co、mcr.microsoft.com

该容器允许您使用.osm.pbf文件轻松搭建OpenStreetMap PNG瓦片服务器。它基于switch2osm.org的最新Ubuntu 18.04 LTS指南,因此使用默认的OpenStreetMap样式,适用于需要自定义地图瓦片服务的场景,如地理信息系统、地图应用开发等。
首先创建Docker卷以存储PostgreSQL数据库(包含OpenStreetMap数据):
docker volume create openstreetmap-data
已渲染的瓦片将存储在/var/lib/mod_tile目录。为确保容器重启后瓦片数据不丢失,需创建另一个卷:
docker volume create openstreetmap-rendered-tiles
从geofabrik.de下载目标区域的.osm.pbf数据文件。通过运行容器并将该文件挂载为/data.osm.pbf,将数据导入PostgreSQL:
docker run -v /绝对路径/至/目标文件.osm.pbf:/data.osm.pbf -v openstreetmap-data:/var/lib/postgresql/10/main cogitoweb/openstreetmap-tile-server import
若容器无错误退出,则数据导入成功,可准备运行瓦片服务器。
运行服务器命令如下:
docker run --shm-size 8g -e THREADS=8 -p 80:80 -p 443:443 -v openstreetmap-data:/var/lib/postgresql/10/main -v /etc/ssl/cogito:/etc/ssl/cogito -v openstreetmap-rendered-tiles:/var/lib/mod_tile cogitoweb/openstreetmap-tile-server:latest run
瓦片可通过http://localhost:80/tile/{z}/{x}/{y}.png访问。首次访问时,较大瓦片的渲染可能需要一定时间。
导入和瓦片服务进程默认使用4个线程,可通过THREADS环境变量调整线程数。示例(使用24线程):
docker run -p 80:80 -e THREADS=24 -v openstreetmap-data:/var/lib/postgresql/10/main -d cogitoweb/openstreetmap-tile-server run
已渲染瓦片存储在/var/lib/mod_tile目录,通过挂载之前创建的openstreetmap-rendered-tiles卷可实现数据持久化:
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main -v openstreetmap-rendered-tiles:/var/lib/mod_tile -d cogitoweb/openstreetmap-tile-server run
将run命令替换为debug即可启用调试模式:
docker run --shm-size 14g -p 80:80 -v osm-europe-data:/var/lib/postgresql/10/main -v /home/ubuntu/osm:/etc/postgresql/10/main/conf.d cogitoweb/openstreetmap-tile-server:latest debug
Copyright 2018 Cogito Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [***] Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录方式配置轩辕镜像加速服务,包含7个详细步骤
在 Linux 系统上配置轩辕镜像源,支持主流发行版
在 Docker Desktop 中配置轩辕镜像加速,适用于桌面系统
在 Docker Compose 中使用轩辕镜像加速,支持容器编排
在 k8s 中配置 containerd 使用轩辕镜像加速
在宝塔面板中配置轩辕镜像加速,提升服务器管理效率
在 Synology 群晖NAS系统中配置轩辕镜像加速
在飞牛fnOS系统中配置轩辕镜像加速
在极空间NAS中配置轩辕镜像加速
在爱快ikuai系统中配置轩辕镜像加速
在绿联NAS系统中配置轩辕镜像加速
在威联通NAS系统中配置轩辕镜像加速
在 Podman 中配置轩辕镜像加速,支持多系统
配置轩辕镜像加速9大主流镜像仓库,包含详细配置步骤
无需登录即可使用轩辕镜像加速服务,更加便捷高效
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429