發行檔與驗證
選擇適合平台的 Zeabur Identity 發行檔,下載並驗證簽章與 checksum 後再執行。
到 GitHub Releases 下載 Zeabur Identity,先驗證簽章與 checksum 再執行。版本號帶有預先發行部分的版本(例如 v0.1.2-beta.1)會標記為預先發行版。
| 平台 | CLI 壓縮檔 | 容器映像檔 |
|---|---|---|
| Linux amd64 / x86_64 | zeabur-identityctl-v<VERSION>-linux-amd64.tar.gz | ghcr.io/zeabur-oss/identity:<VERSION> |
| Linux arm64 / aarch64 | zeabur-identityctl-v<VERSION>-linux-arm64.tar.gz | 使用相同的映像檔 tag,Docker 會選擇你的架構 |
如果使用 macOS、Windows 或其他架構,需要從原始程式碼建置 CLI。
每個發行版本都包含 checksum、簽章與 SBOM。SBOM 列出發行檔包含的相依套件,供下載的 SBOM 檔名以 .cdx.json 結尾。
映像檔 digest
Section titled “映像檔 digest”發行檔 digests.txt 用 digest 列出容器映像檔:每個平台的映像檔一行,多平台 index 一行。部署時請固定使用 index 那行的 digest。
linux/amd64 ghcr.io/zeabur-oss/identity@sha256:...linux/arm64 ghcr.io/zeabur-oss/identity@sha256:...index ghcr.io/zeabur-oss/identity@sha256:...SHA256SUMS 涵蓋 digests.txt、resources.json 和其他所有發行檔,SHA256SUMS.sigstore.json 則是 SHA256SUMS 的簽章。以下步驟會先驗證這兩個檔案,再讀取 digest。
發行檔 resources.json 以 MiB 記錄 zeabur-identityctl manifests 以預設值安裝時,所有 Pod 要求的記憶體總量。安裝程式可以在下載其他東西之前,先用它確認伺服器的記憶體夠用。
{"requestMemoryMiB": 24}發行檔由本儲存庫的發行 workflow 在 GitHub Actions 中簽署,簽章憑證的身分是 zeabur-oss/identity/.github/workflows/release.yml,執行對象的儲存庫與 ref 則是 zeabur-oss/identity 和發行標籤。以下指令會檢查這三項。
v0.3.0 及更早的版本由 zeabur-oss/.github 的 release.yml 簽署,驗證時改用 identity='^https://github\.com/zeabur-oss/\.github/\.github/workflows/release\.yml@';來源證明則用 --signer-workflow zeabur-oss/.github/.github/workflows/release.yml。
你需要 GitHub CLI(gh)、cosign 3.x 與 GNU sha256sum。拉取映像檔還需要 Docker。除了 Docker,其他命令列工具都可在儲存庫的 nix develop shell 中使用。
選擇版本與架構並下載
Section titled “選擇版本與架構並下載”設定發行版本與架構,再下載該版本的檔案:
version=v0.1.1arch=arm64 # use amd64 for x86_64identity='^https://github\.com/zeabur-oss/identity/\.github/workflows/release\.yml@'gh release download "$version" --repo zeabur-oss/identity --dir downloaded驗證簽章與 checksum
Section titled “驗證簽章與 checksum”先驗證 SHA256SUMS 的簽章,再用它檢查下載的檔案。
( set -e cd downloaded cosign verify-blob --bundle SHA256SUMS.sigstore.json \ --certificate-identity-regexp "$identity" \ --certificate-github-workflow-repository zeabur-oss/identity \ --certificate-github-workflow-ref "refs/tags/$version" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com SHA256SUMS sha256sum --check --strict SHA256SUMS)解壓縮並執行 CLI
Section titled “解壓縮並執行 CLI”兩項檢查都通過後,再解壓縮並試用 CLI:
tar -xzf "downloaded/zeabur-identityctl-$version-linux-$arch.tar.gz"./zeabur-identityctl --help驗證並拉取容器映像檔
Section titled “驗證並拉取容器映像檔”從已通過檢查的 digests.txt 讀取映像檔 digest。
image=$(awk '$1 == "index" {print $2}' downloaded/digests.txt)cosign verify --certificate-identity-regexp "$identity" \ --certificate-github-workflow-repository zeabur-oss/identity \ --certificate-github-workflow-ref "refs/tags/$version" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com "$image"cosign verify-attestation --type cyclonedx --certificate-identity-regexp "$identity" \ --certificate-github-workflow-repository zeabur-oss/identity \ --certificate-github-workflow-ref "refs/tags/$version" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com "$image"docker pull --platform "linux/$arch" "$image"驗證建置來源(選用)
Section titled “驗證建置來源(選用)”GitHub 也為每個發行檔和映像檔記錄建置來源(build provenance)。使用已登入的 gh:
gh attestation verify "downloaded/zeabur-identityctl-$version-linux-$arch.tar.gz" \ --repo zeabur-oss/identity --source-ref "refs/tags/$version" \ --signer-workflow zeabur-oss/identity/.github/workflows/release.ymlgh attestation verify "oci://$image" \ --repo zeabur-oss/identity --source-ref "refs/tags/$version" \ --signer-workflow zeabur-oss/identity/.github/workflows/release.yml