R's Workshop

Assign Repo Version Used for Repo-based Project Management

Google 的 git-repo 在 v2.19 後修改了每個 git project 的 .git/ softlink 方式. (參考 commit 2a089cf.) 這造成我用 docker 的 overlayfs 特性省 source code 空間的手法 (mount .repo 進 docker container) 失效. 所以目前的 workaround 方法就是指定 re... Read more

Gerrit Submit Types vs. Git Commands

使用 Gerrit 管理 git projects 時, 使用者的 commit 會先 push 到一個 review branch, 形成一個 Gerrit change. 等 review 和 CI 流程跑完 (reviewed+2/verified+1), 使用者從 Gerrit submit change 後, commit 才會正式 submit 到 git repository ... Read more

Linux Page Size

Linux 預設一個 page 的大小是 4KB. Macro PAGE_SIZE 定義在每個 arch 的資料夾下 但在 embedded system 上, 為了有效使用記憶體 (e.g. 避免 internal fragmentation), 有可能會修改 PAGE_SIZE. 除了直接看 code 外, 這裡提供兩種方法從執行中的系統中確認 page size. Read more

Difference between Docker ADD and COPY commands

這篇紀錄一下 Dockerfile 中 ADD 和 COPY 使用上的差異. 先講結論: 除了新增一個需要解壓縮的檔案到 image 時使用 ADD 外, 絕大部分的情況下都建議使用 COPY. Read more

Use Multi-stage Builds to Generate Smaller Docker Images

縮減 image size 除了使用之前提到的 docker export/import 方法外, 另一個作法就是使用 docker 在 v17.05 開始提供的 multi-stage builds 來建制 docker image. Read more