pickfit

瀏覽開發者 CLI

dive

用來探索 Docker 映像檔圖層並找出縮減大小方法的工具。

已在 Linux 上測試有已知漏洞

使用

安裝前先知道:有已知漏洞

pickfit 在安裝時會一併裝上的套件裡找到 1 個已知的高風險或嚴重漏洞(OSV.dev,2026年11月5日),安裝前請先考慮。

  • go:github.com/go-jose/go-jose/v4 v4.1.5 Go JOSE:解析包含 RSA 金鑰的 JWK 時發生 DoS (GHSA-mgcc-cww5-fp2q,高風險,4.1.6 已修正)

Linux x86_64

  1. 從 GitHub releases 下載 dive v0.13.1 linux_amd64 tarball 並安裝至 ~/.local/bin

    DIVE_VERSION=0.13.1
    curl -fL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.tar.gz" -o /tmp/dive.tar.gz
    mkdir -p ~/.local/bin
    tar -xzf /tmp/dive.tar.gz -C /tmp && mv /tmp/dive ~/.local/bin/dive && chmod +x ~/.local/bin/dive && ~/.local/bin/dive --version

確認能用

dive --version

輸出應包含「dive 0.13.1」。

先試試這個

cat > /tmp/make_archive.py <<'PYEOF'
import tarfile, json, os, io, tempfile, hashlib

tmpdir = "/tmp/dive-image"
os.makedirs(tmpdir, exist_ok=True)

# Create two layers to test layer diff
# Layer 1: contains /hello.txt
# Layer 2: adds /world.txt and modifies /hello.txt

def make_layer_tar(files, path):
    buf = io.BytesIO()
    with tarfile.open(fileobj=buf, mode='w') as tf:
        for name, content in files.items():
            data = content.encode()
            ti = tarfile.TarInfo(name=name)
            ti.size = len(data)
            ti.mtime = 0
            tf.addfile(ti, io.BytesIO(data))
    data = buf.getvalue()
    with open(path, 'wb') as f:
        f.write(data)
    return hashlib.sha256(data).hexdigest()

layer1_hash = make_layer_tar({"hello.txt": "hello from layer1\n"}, "/tmp/dive-image/layer1.tar")
layer2_hash = make_layer_tar({"world.txt": "hello world\n", "hello.txt": "modified hello\n"}, "/tmp/dive-image/layer2.tar")

# Create config json
config = {
    "architecture": "amd64",
    "os": "linux",
    "rootfs": {"type": "layers", "diff_ids": [f"sha256:{layer1_hash}", f"sha256:{layer2_hash}"]},
    "history": [{"created": "2025-01-01T00:00:00Z"}, {"created": "2025-01-02T00:00:00Z"}],
    "config": {}
}
import hashlib as hl
config_data = json.dumps(config).encode()
config_hash = hl.sha256(config_data).hexdigest()

with open(f"/tmp/dive-image/{config_hash}.json", "wb") as f:
    f.write(config_data)

# manifest.json
manifest = [{
    "Config": f"{config_hash}.json",
    "RepoTags": ["test:latest"],
    "Layers": ["layer1.tar", "layer2.tar"]
}]
with open("/tmp/dive-image/manifest.json", "w") as f:
    json.dump(manifest, f)

with open("/tmp/dive-image/repositories", "w") as f:
    json.dump({"test": {"latest": "layer2"}}, f)

# Create docker save tarball
with tarfile.open("/tmp/test-image.tar", "w") as out:
    for fname in ["manifest.json", "repositories", f"{config_hash}.json", "layer1.tar", "layer2.tar"]:
        out.add(f"/tmp/dive-image/{fname}", arcname=fname)

print(f"Created /tmp/test-image.tar with layers {layer1_hash[:12]}, {layer2_hash[:12]}, config {config_hash[:12]}")
print(f"Size: {os.path.getsize('/tmp/test-image.tar')}")

PYEOF
python3 /tmp/make_archive.py
tar -tvf /tmp/test-image.tar
dive --source docker-archive /tmp/test-image.tar --json /tmp/dive-output.json

它能做什麼

  • 標示各圖層的變更內容
    已測試
  • 估算映像檔效率與浪費空間
    已測試
  • 依圖層顯示 Docker 映像檔內容
    沒有看到它可用
  • 建置映像檔並立即分析
    未測試

pickfit 測到哪一步

Linux x86_64

  1. 可以安裝
  2. 可以啟動
  3. 4 項功能中 2 項可用
  4. 可離線使用

適合用來

  • 依圖層瀏覽 Docker 映像檔內容
  • 估算映像檔效率與浪費空間

pickfit 怎麼測的

每次測試都從乾淨的機器開始,照上面的步驟執行。 pickfit 怎麼驗證

Linux x86_64

主要功能可用

  • 從頭重跑
  • 可離線使用
  • 檢查於 2026年11月4日
  • 版本 0.13.1

測試機器遇到的差異

  • README: Install via go install or pacman -S dive (and brew/docker)
    測試中: 在沒有 Go/Docker 的 Debian 上,從 GitHub releases 下載預先建置的 linux_amd64 tarball 並解壓縮至 ~/.local/bin
  • README: dive nginx:latest uses Docker daemon by default
    測試中: 使用 --source docker-archive 搭配自製的 docker save tarball 在無 Docker daemon 的情況下測試;v0.13.1 中無 registry 來源
  • README: dive build builds via Docker
    測試中: dive build 需要 docker 用戶端執行檔;缺少時會優雅地失敗

怎麼看工具卡

縫線
pickfit 親自安裝過這款工具,縫線下方的內容都來自那次測試。沒測過的工具,一律沒有縫線。
已在你的作業系統上驗證
安裝步驟在你選的系統上跑過。「只在 Linux 上執行過」表示還沒在你的系統上跑過。
macOS、Linux 和 Windows在哪裡測過
綠色系統標記:pickfit 在該系統跑過安裝步驟。灰色:README 說支援,但 pickfit 還沒試過。
測試進行到哪一步
能安裝並啟動、主要功能可用、服務有回應、能產生模型輸出。視窗代表桌面應用程式已開啟;插頭代表 MCP 用戶端用過它。標記在測試結果旁邊:展開「為什麼適合、我們怎麼知道」,或在「pickfit 怎麼測的」裡。
視覺檢查
pickfit 看過應用程式的截圖。綠色:畫面正常。黃色加數字:有看起來不對的地方,點開就能看到。灰色虛線:還沒檢查。
已知漏洞
它安裝的套件有沒有已知的高風險或嚴重漏洞(OSV.dev)。綠色:沒有已知漏洞。紅色加數字:有幾個,點開看清單,安裝前先看過。灰色虛線:沒有檢查,不代表安全。
關於這次測試
測試日期,以及測到的版本。
理由的來源
每個推薦理由都依據簡介裡的一個欄位。展開理由就能看到欄位和值。
寶藏
品質高、少有人知。
品質與知名度
兩個分數,滿分都是 100。品質:pickfit 試裝、試用的結果,以及安裝文件和維護狀況。知名度:看星數、下載量和 Hacker News。
已檢查的功能
README 宣傳的主要功能裡,實測通過幾項(綠色)、失敗幾項(紅色)。灰色是沒檢查的,工具卡會說明原因。
未驗證
Fitz 依一般知識提到的知名工具。沒有測試紀錄、沒有步驟、沒有分數。