Post

OpenClaw 更新流程記錄

OpenClaw 更新流程記錄

從 upstream 同步並發布 Docker image 至 GitHub Container Registry

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    更新版本
    v2026.4.22


    更新日期
    2026-04-24


    Fork 倉庫
    github.com/kuniakil/openclaw


    上游倉庫
    github.com/openclaw/openclaw

事前準備

1
2
3
4
    0
    清理本地端的備份檔案

在更新之前,先清理工作區域中可能殘留的備份檔案,避免衝突或遺留舊版資料。

`# 查找所有備份檔案(.backup, ~ 等) find /Users/mlee/openclaw-test/openclaw -name “.backup” -o -name “~” -type f 2>/dev/null

刪除確認的備份檔

find /Users/mlee/openclaw-test/openclaw -name “.backup” -delete find /Users/mlee/openclaw-test/openclaw -name “*~” -delete

1
2
3
4
5
6
7
8
9
10
11
12
13
14
## 同步上游代碼

    
        1
        確認並檢視遠端倉庫設定
    
    確認 fork 的 remote 設定,確保有 both origin`(你自己的 repo)和 `upstream`(OpenClaw 官方)。

`git remote -v
origin    https://github.com/kuniakil/openclaw.git (fetch)
origin    https://github.com/kuniakil/openclaw.git (push)
upstream  https://github.com/openclaw/openclaw.git (fetch)
upstream  https://github.com/openclaw/openclaw.git (push)
1
2
3
4
5
6
7
8
9
10
    **提示:**如果沒有 upstream,可以執行:

    git remote add upstream https://github.com/openclaw/openclaw.git`



    2
    從上游 fetch 最新程式碼

擷取上游的最新 commits 和 branches,確保本地的 upstream/main 是最新的。

`git fetch upstream From https://github.com/openclaw/openclaw

  • [new branch] main -> upstream/main ```

    1
    2
    
     3
     檢視並確認上游的更新內容
    

    檢視 upstream/main 的最新 commit,確認版本和變更內容。

git log upstream/main –oneline -10 ef2d9d7949 chore(docker-release): make workflow dispatch only a6c4363e59 Merge remote-tracking branch ‘upstream/main’ ac063568d3 test: speed up live model sweeps d717dbba51 Merge branch ‘main’ of https://github.com/openclaw/openclaw adc71beeed chore: add docker runtime data to gitignore … git log upstream/main –oneline | head -1 ef2d9d7949 chore(docker-release): make workflow dispatch only

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    
        **版本標記:**2026.4.22 版本對應的 tag 是 v2026.4.22`,可用以下指令確認:
        
`git tag --list 'v2026*' | tail -5`
    

    
        4
        切換到 main branch 並合併上游變更
    
    確保你在本地 main branch,然後rebase 上游的最新進度。

`git checkout main
Already on 'main'
git pull --rebase upstream main
Already up to date.
1
2
3
4
5
6
7
8
    **注意:**如果有任何本地變更尚未 commit,先 stash 或 commit,否則 rebase 可能會失敗。



    5
    推送更新到你的 GitHub Fork

將同步後的 main branch 推送回你的 origin repository。

git push origin main Total 0 objects. Everything up-to-date.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    
        **成功:**你的 fork 現在已與上游 OpenClaw/main 保持同步。
    

## 觸發 GitHub Actions Docker Build

    
        6
        手動觸發 Docker Release Workflow
    
    因為需要發布到 GitHub Container Registry (ghcr.io),手動透過 GitHub CLI 觸發 workflow。

gh workflow run docker-release.yml -f tag=v2026.4.22
✓ Created workflow_dispatch event for docker-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    **說明:**此 workflow 會:
    

        - Build 多架構 image(amd64 + arm64)

        - Push 到 ghcr.io/kuniakil/openclaw:2026.4.22`

        - 支援手動重新 build 特定版本(用於 backfill)

    




    7
    監控 Build 進度

檢查 workflow 執行狀態,直到完成。

gh run list –workflow=docker-release.yml –limit 1 STATUS NAME BRANCH EVENT UPDATED queued docker-release main workflow_dispatch just now

1
2
3
4
gh run watch
Waiting for run to finish... Press Ctrl+C to abort.
docker-release: building amd64 #1254 ✓ Completed
1
2
3
4
    8
    驗證 Image 已發布

透過 GitHub CLI 確認 image 已成功推送到 GHCR。

gh api repos/kuniakil/openclaw/actions/runs –jq ‘.workflow_runs[0] | {status:.status, conclusion:.conclusion, head_sha:.head_sha}’ {“status”: “completed”, “conclusion”: “success”, “head_sha”: “ef2d9d7949”}

1
2
3
4
5
6
7
8
9
10
11
12
13
## 本地端升級 Docker Image

    
        9
        檢視目前安裝的 Image
    
    在 pull 新版之前,先確認目前系統中的 OpenClaw images。

docker images | grep -i openclaw
coollabsio/openclaw:latest      7c43ad2efa78  5.34GB  1.37GB
ghcr.io/kuniakil/openclaw:2026.3.13-1  a5a4c83b773a  2.77GB  639MB
ghcr.io/openclaw/openclaw:2026.3.13-1  a5a4c83b773a  2.77GB  639MB
1
2
3
4
5
6
7
8
    **留意:**本地可能有多個來源的 image(coollabsio、ghcr.io/kuniakil、ghcr.io/openclaw),清理前確認哪些不再需要。



    10
    Pull 最新版本 Image

從 GHCR pull 你剛發布的 2026.4.22 版本。

docker pull ghcr.io/kuniakil/openclaw:2026.4.22 2026.4.22: Pulling from kuniakil/openclaw Digest: sha256:ab3… (256-bit hash) Status: Image is up to date for ghcr.io/kuniakil/openclaw:2026.4.22

1
2
3
4
5
6
7
8
9
10
11
    
        11
        驗證本地 Image 列表
    
    確認新 image 已成功 pull 到本地。

docker images | grep -i openclaw
coollabsio/openclaw:latest           7c43ad2efa78  5.34GB  1.37GB
ghcr.io/kuniakil/openclaw:2026.4.22  2596c35a58c9  4.11GB  848MB
ghcr.io/kuniakil/openclaw:2026.3.13-1  a5a4c83b773a  2.77GB  639MB

清理旧版本 Image(如需要)

1
2
3
4
    12
    刪除舊版 Image 釋放磁碟空間

確認新版本正常運作後,可以刪除不再需要的舊版 image。

docker rmi ghcr.io/kuniakil/openclaw:2026.3.13-1 Untagged: ghcr.io/kuniakil/openclaw:2026.3.13-1 Deleted: sha256:a5a4c83b773a…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    
        **警告:**刪除 image 前請確認:
        

            - 新版本已通過測試

            - 沒有其他服務依赖該版本

            - 已備份任何自定義設定

        

    

## 完整指令速查

# 1. 同步上游
git fetch upstream
git checkout main
git pull --rebase upstream main
git push origin main
# 2. 觸發 GitHub Actions Build
gh workflow run docker-release.yml -f tag=v2026.4.22
gh run watch
# 3. 本地升級
docker pull ghcr.io/kuniakil/openclaw:2026.4.22
# 4. 清理舊版(確認新版本正常後)
docker rmi ghcr.io/kuniakil/openclaw:2026.3.13-1
1
2
3
更新日期:2026-04-24 | 版本:v2026.4.22

Generated for WordPress documentation
This post is licensed under CC BY 4.0 by the author.