如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
一组带有特定观点的容器镜像集合
此处构建的容器不使用传统意义上的不可变标签(如 https://fleet.linuxserver.io/ 或 https://bitnami.com/stacks/containers 所采用的方式)。相反,我们坚持固定镜像的 sha256 摘要。虽然这种方式视觉上不够直观,但能确保功能和不可变性。
| 容器 | 不可变 |
|---|---|
ghcr.io/home-operations/home-assistant:rolling | ❌ |
ghcr.io/home-operations/home-assistant:2025.5.1 | ❌ |
ghcr.io/home-operations/home-assistant:rolling@sha256:8053... | ✅ |
ghcr.io/home-operations/home-assistant:2025.5.1@sha256:8053... | ✅ |
如果将镜像固定到 sha256 摘要,像 https://github.com/renovatebot/renovate 这样的工具可以基于摘要或版本变更来更新容器。
默认情况下,我们的大多数容器以非 root 用户(65534:65534)运行,您可以通过更新配置文件来更改用户/组。
Docker Compose
services:
home-assistant:
image: ghcr.io/home-operations/home-assistant:2025.5.1@sha256:516ae5c85089b3f2960cf2a21dc3c105356969499964fabf0b0358e5f3a7e0a2
container_name: home-assistant
user: 1000:1000 # 数据卷权限必须与此用户:组匹配
read_only: true # 可能需要将额外目录挂载为 tmpfs
tmpfs:
- /tmp:rw
# ...
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: home-assistant
# ...
spec:
# ...
template:
# ...
spec:
containers:
- name: home-assistant
image: ghcr.io/home-operations/home-assistant:2025.5.1@sha256:516ae5c85089b3f2960cf2a21dc3c105356969499964fabf0b0358e5f3a7e0a2
securityContext: # 可能需要将额外目录挂载为 emptyDir
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- name: tmp
mountPath: /tmp
# ...
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000 # (需要 CSI 支持)
fsGroupChangePolicy: OnRootMismatch # (需要 CSI 支持)
volumes:
- name: tmp
emptyDir: {}
# ...
# ...
某些应用仅允许通过命令行参数而非环境变量进行特定配置。有关此类情况,请参考 Kubernetes 文档中关于https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/的部分。然后,如下所示指定所需参数:
args:
- --port
- "8080"
对于需要持久化配置数据的应用,配置卷在容器内硬编码为 /config。在大多数情况下,此路径无法更改。
这些容器镜像使用 https://github.com/actions/attest-build-provenance action 进行签名。
要验证镜像是否由 GitHub CI 构建,请使用以下命令:
gh attestation verify --repo home-operations/containers oci://ghcr.io/home-operations/${APP}:${TAG}
或使用 https://github.com/sigstore/cosign:
cosign verify-attestation --new-bundle-format --type slsaprovenance1 \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
--certificate-identity-regexp "^https://github.com/home-operations/containers/.github/workflows/app-builder.yaml@refs/heads/main" \
ghcr.io/home-operations/${APP}:${TAG}
本仓库不支持同一应用的多个"渠道"。例如:
这种方式确保了一致性并专注于简化构建流程。
我们鼓励尽可能使用官方上游容器镜像。但在以下情况下,为本仓库贡献可能是合理的:
本仓库中的容器可能因以下原因被弃用:
[!NOTE] 弃用的容器将通过发布公告,并在 registry 中保留 6 个月后移除。
本仓库的灵感和想法来自 home-ops 社区、https://hotio.dev/ 以及 https://www.linuxserver.io/ 的贡献者。
来自真实用户的反馈,见证轩辕镜像的优质服务