calendar gateway镜像是一个轻量级日历网关服务,旨在整合各类第三方日历数据源(如Google Calendar、Microsoft Outlook Calendar、Apple Calendar等),提供统一的API接口,简化应用程序对接多个日历服务的开发复杂度,实现日历数据的集中获取、转发与同步管理。
通过以下命令快速启动日历网关服务(默认配置下仅启动基础服务,需进一步配置日历源):
bashdocker run -d -p 8080:8080 --name calendar-gateway calendar-gateway:latest
通过环境变量配置网关基础参数,常用环境变量说明如下:
| 环境变量名 | 描述 | 默认值 |
|---|---|---|
PORT | 服务监听端口 | 8080 |
SUPPORTED_CALENDARS | 启用的日历源列表(逗号分隔,如google,outlook,icloud) | google |
LOG_LEVEL | 日志级别(支持debug/info/warn/error) | info |
TIMEOUT | 日历源请求超时时间(单位:秒) | 30 |
需为启用的日历源配置认证信息,支持环境变量或配置文件两种方式:
方式1:环境变量配置(以Google Calendar为例)
bashdocker run -d -p 8080:8080 \ -e PORT=8080 \ -e SUPPORTED_CALENDARS=google,outlook \ -e GOOGLE_CLIENT_ID="your_google_client_id" \ -e GOOGLE_CLIENT_SECRET="your_google_client_secret" \ -e OUTLOOK_CLIENT_ID="your_outlook_client_id" \ -e OUTLOOK_CLIENT_SECRET="your_outlook_client_secret" \ --name calendar-gateway calendar-gateway:latest
方式2:配置文件配置
创建config.yaml配置文件,定义日历源及服务参数:
yamlcalendars: google: client_id: "your_google_client_id" # Google Calendar API客户端ID client_secret: "your_google_client_secret" # Google Calendar API客户端密钥 scope: "https://www.googleapis.com/auth/calendar.events.readonly" # 权限范围 outlook: client_id: "your_outlook_client_id" # Outlook Calendar API客户端ID client_secret: "your_outlook_client_secret" # Outlook Calendar API客户端密钥 tenant: "common" # 租户ID(Outlook专用,默认common) server: port: 8080 # 服务监听端口 timeout: 30 # 请求超时时间(秒) log: level: "info" # 日志级别
通过挂载配置文件启动服务:
bashdocker run -d -p 8080:8080 \ -v $(pwd)/config.yaml:/app/config/config.yaml \ --name calendar-gateway calendar-gateway:latest
通过统一API接口与网关交互,以下为获取日历事件的示例请求:
bashcurl "http://localhost:8080/api/v1/calendars/google/events?start_date=2024-01-01&end_date=2024-01-31"
google:目标日历源名称(需与配置中的日历源名称一致)start_date/end_date:事件查询的日期范围(格式:YYYY-MM-DD)响应示例(统一JSON格式):
json{ "events": [ { "id": "event_123", "title": "团队周会", "start_time": "2024-01-05T09:00:00Z", "end_time": "2024-01-05T10:00:00Z", "location": "会议室A", "description": "本周项目进度同步" } ], "source": "google", "total": 1 }
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务