Leaves

Leaves

This website is a Microblog that allows you to post in Markdown.
Sign in with your Google account and use it.

chatbot

  • chatbot backend
    • AI Gateway, LLM
    • Tool
      • APIs
      • DB
      • ベクトルDB(RAG, ナレッジ)

Leaves CLI alias

alias s='docker run -it --rm oven/bun bunx @chibat/leaves'

あえて WSL1 をインストールする

wsl --install Ubuntu --name wsl1
wsl --set-version wsl1 1
CommentEdit1 Like

wslc

notepad $PROFILE   # ファイルがなければ先に New-Item -Force $PROFILE
Set-Alias docker wslc

WSL + Docker 環境の使用領域を縮小する


確認

WSL の仮想ディスクを確認

PowerShell:

Get-ChildItem $env:LOCALAPPDATA -Recurse -Filter ext4.vhdx -ErrorAction SilentlyContinue |
Select-Object FullName,Length

ext4.vhdx のパスとサイズが確認できる。

Docker 使用量を確認
docker system df

一括削除

$ docker system prune -a --volumes

削除対象:

  • 停止済みコンテナ
  • 未使用イメージ
  • 未使用ネットワーク
  • 未使用ボリューム
  • Build Cache

WSL 仮想ディスクを圧縮

WSL 停止

PowerShell:

PS > wsl --shutdown
VHDX 圧縮

管理者 PowerShell:

PS > diskpart
DISKPART> select vdisk file="<ext4.vhdx へのパス>"
DISKPART> compact vdisk
DISKPART> exit

削除分が確実に C ドライブへ反映される。


Appendix

Docker ボリューム詳細確認
docker system df -v

Docker の不要データ削除

Build Cache 削除
docker builder prune -a
停止済みコンテナ削除
docker container prune
未使用イメージ削除
docker image prune -a
未使用 Volume 削除

⚠️ データ削除あり

docker volume prune