概要

フル名
docker.io/kdhrubo/db2rest
Registry
docker.io
名前空間
kdhrubo
リポジトリ
db2rest
キャッシュ Tag 数
56
最終同期
07/06/2026, 02:48 PM

概要

Db2Rest 开源镜像,将 PostgreSQL/MySQL 等关系库表自动暴露为 REST API,适合快速原型、内网数据网关与低代码后端。

詳細

kdhrubo/db2rest 读取数据库元数据并生成 CRUD HTTP 端点,支持 JWT、分页与 OpenAPI 文档。典型用于内部工具或 BFF 层快速对接遗留库,完整 ORM 框架替代品。与 Hasura 相比更轻、偏 JDBC 直连;生产应固定 tag、只读账号最小权限,并通过反向代理启用 HTTPS 与 rate limit。

快速启动

docker run -d --name db2rest \
  -p 8080:8080 \
  -e DB_URL=jdbc:postgresql://postgres:5432/mydb \
  -e DB_USER=readonly \
  -e DB_PASSWORD=secret \
  docker.io/kdhrubo/db2rest:latest

推荐实践

docker run -d --name db2rest \
  --restart unless-stopped \
  -p 8080:8080 \
  -e DB_URL=jdbc:postgresql://postgres.internal:5432/app \
  -e DB_USER=db2rest_ro \
  -e DB_PASSWORD=strong-pass \
  -e JWT_SECRET=long-random-secret \
  -e SERVER_PORT=8080 \
  docker.io/kdhrubo/db2rest:1.2.0

核心参数说明

  • -p 8080:8080 — REST API 监听端口
  • -e DB_URL — JDBC 连接串
  • -e DB_USER/DB_PASSWORD — 数据库凭据(建议只读)
  • -e JWT_SECRET — API 鉴权签名密钥
  • --restart unless-stopped — 内网网关持续可用
  • 固定 tag — 与 API 行为版本 pin

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: db2rest
spec:
  replicas: 2
  selector:
    matchLabels:
      app: db2rest
  template:
    metadata:
      labels:
        app: db2rest
    spec:
      containers:
        - name: db2rest
          image: docker.io/kdhrubo/db2rest:1.2.0
          ports:
            - containerPort: 8080
          envFrom:
            - secretRef:
                name: db2rest-secrets
---
apiVersion: v1
kind: Service
metadata:
  name: db2rest
spec:
  selector:
    app: db2rest
  ports:
    - port: 8080
      targetPort: 8080

JDBC 与 JWT 经 Secret 注入;Ingress 暴露 HTTPS 并限制来源 IP,数据库连接指向集群外或 RDS。

Tagアーキテクチャプッシュ日時サイズDigest同期期望操作
docker.io/kdhrubo/db2rest
:latest
linux/amd64
2025/12/21 10:06126.1 MBsha256:e20610ff81b0
docker.io/kdhrubo/db2rest
:v1.6.8
linux/amd64
2025/12/21 10:06126.1 MBsha256:e20610ff81b0
docker.io/kdhrubo/db2rest
:v1.6.8-RC1
linux/amd64
2025/12/21 09:24126.1 MBsha256:63f1958d695f
docker.io/kdhrubo/db2rest
:v1.6.6-GA
linux/amd64
2025/09/27 09:37129.2 MBsha256:e57c9bccd03b
docker.io/kdhrubo/db2rest
:v1.6.6-RC2
linux/amd64
2025/09/27 09:24129.2 MBsha256:5c5212514678
docker.io/kdhrubo/db2rest
:v1.6.6-RC1
linux/amd64
2025/09/26 11:45129.2 MBsha256:5d39e0794bf2
docker.io/kdhrubo/db2rest
:v1.6.6
linux/amd64
2025/09/26 11:13129.2 MBsha256:c06160b65e76
docker.io/kdhrubo/db2rest
:v1.6.5
linux/amd64
2025/07/19 12:35123.3 MBsha256:63523cd73c5b
docker.io/kdhrubo/db2rest
:v1.6.4
linux/amd64
2025/07/18 06:06109.6 MBsha256:3f7aeaf282b6
docker.io/kdhrubo/db2rest
:v1.6.4-RC1
linux/amd64
2025/07/18 05:58109.6 MBsha256:2dabbd3f7220
docker.io/kdhrubo/db2rest
:v1.6.1
linux/amd64
2025/07/04 07:38109.6 MBsha256:0b915e82f6b5
docker.io/kdhrubo/db2rest
:v1.6.0
linux/amd64
2025/03/08 19:03109.9 MBsha256:af1350aae293
docker.io/kdhrubo/db2rest
:v1.5.1
linux/amd64
2025/02/04 23:00116.1 MBsha256:be67c12eec95
docker.io/kdhrubo/db2rest
:v1.5.0
linux/amd64
2025/02/04 17:11135.0 MBsha256:76301e196dc1
docker.io/kdhrubo/db2rest
:v1.4.2
linux/amd64
2024/12/15 13:23113.5 MBsha256:a3004839307a
docker.io/kdhrubo/db2rest
:v1.4.1
linux/amd64
2024/11/30 19:05113.5 MBsha256:0698ca3ce1ff
docker.io/kdhrubo/db2rest
:v1.4.0
linux/amd64
2024/11/25 15:38113.4 MBsha256:00805bd68f90
docker.io/kdhrubo/db2rest
:v1.3.8-RC21
linux/amd64
2024/11/25 13:52113.3 MBsha256:c779b1774360
docker.io/kdhrubo/db2rest
:v1.3.8-RC20
linux/amd64
2024/11/25 13:01377.6 MBsha256:e2c7e919d297
docker.io/kdhrubo/db2rest
:v1.3.8-RC19
linux/amd64
2024/11/25 12:5853.3 MBsha256:0ab6131d4de0