Tag: docker

  • How to shrink Docker Virtual Harddisk: docker_data.vhdx

    I just discovered that I had a >120 GB VHDX file in “%LOCALAPPDATA%\Docker\wsl\disk\docker_data.vhdx“).

    According to the description of Ahmed Moussa on dev.to (and some other articles), this is the virtual hard disk when using Docker for Windows and WSL. The Virtual Harddisk is dynamically increasing when needed. Unfortunately not decreasing.

    To compact and reclaim free space, perform those steps:

    1. Prune docker (see the FAQ)
      docker system prune -a --volumes
      this freed ~15 GB
    2. Compact the virtual Hard disk(s) (VHDX)
      • Stop Docker: “Quit Docker Desktop” from the Tray Icon
      • Shut Down WSL:
        wsl --shutdown
      • Compact the VHDX in Powershell (manual page):
        Optimize-VHD -Path "PATH/TO/VHDX" -Mode Full
        (Reclaimed ~85 GB)

    Fediverse Reactions
  • How to solve weird Docker Errors on Ubuntu

    After being so happy about all the services that I brought up last weekend, I forgot to do one thing: rebooting. Today I rebooted for some reason and the containers didn’t came up again.

    (more…)