Overview
- Full name
docker.io/addozhang/spring-boot-rest- Registry
- docker.io
- Namespace
- addozhang
- Repository
- spring-boot-rest
- Cached tags
- 1
- Last synced
- 07/06/2026, 11:42 AM
Introduction
Spring Boot REST 示例 API 镜像,演示 CRUD 与 Actuator 健康检查,适合 K8s 微服务 PoC 与 CI 集成测试基线。
Details
addozhang/spring-boot-rest 打包轻量 Spring Boot 应用,暴露 REST 端点与 /actuator/health 探针。典型作为 Service Mesh、Ingress 或 HPA 演示的后端样例,与 production 业务镜像相比无领域逻辑、便于替换。生产 PoC 应固定 tag、外置 H2/PostgreSQL 并配置 resource limits,JWT/OAuth 按实际需求扩展。
快速启动
docker run -d --name spring-boot-rest \
-p 8080:8080 \
docker.io/addozhang/spring-boot-rest:latest
推荐实践
docker run -d --name spring-boot-rest \
--restart unless-stopped \
-p 8080:8080 \
-e SPRING_PROFILES_ACTIVE=prod \
-e JAVA_OPTS="-Xms256m -Xmx512m" \
docker.io/addozhang/spring-boot-rest:1.0.0
核心参数说明
-p 8080:8080— REST API 与 Actuator 端口-e SPRING_PROFILES_ACTIVE=prod— 生产配置 profile-e JAVA_OPTS— JVM 堆内存限制--restart unless-stopped— API 服务持续在线- 固定 tag — 应用版本 pin
- 探针 —
/actuator/health用于 K8s readiness
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-boot-rest
spec:
replicas: 3
selector:
matchLabels:
app: spring-boot-rest
template:
metadata:
labels:
app: spring-boot-rest
spec:
containers:
- name: app
image: docker.io/addozhang/spring-boot-rest:1.0.0
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
resources:
requests:
memory: 512Mi
cpu: "250m"
---
apiVersion: v1
kind: Service
metadata:
name: spring-boot-rest
spec:
selector:
app: spring-boot-rest
ports:
- port: 8080
targetPort: 8080
Ingress 暴露 API;HPA 按 CPU 扩缩,生产替换为真实业务镜像。
Latest tags (20)
View all 1 tags →| Tag | Arch | Pushed At | Size | Digest | Sync | Wish | Action |
|---|---|---|---|---|---|---|---|
docker.io/addozhang/spring-boot-rest :latest | linux/amd64linux/arm64 | 2023/12/23 07:17 | 80.2 MB | sha256:32e2534bbca3… |