windows docker設定

docker image搬離開系統槽

https://stackoverflow.com/questions/62441307/how-can-i-change-the-location-of-docker-images-when-using-docker-desktop-on-wsl2

  1. 關閉wsl2

    1
    wsl --shutdown
  2. 匯出docke檔案

    1
    wsl --export docker-desktop-data "D:\Docker\wsl\data\docker-desktop-data.tar"
  3. unregister

    1
    wsl --unregister docker-desktop-data
  4. 匯入

    1
    wsl --import docker-desktop-data "D:\Docker\wsl\data" "D:\Docker\wsl\data\docker-desktop-data.tar" --version 2

wsl2 volume

https://stackoverflow.com/questions/61083772/where-are-docker-volumes-located-when-running-wsl-using-docker-desktop

Author

Steven

Posted on

2023-04-19

Updated on

2025-01-14

Licensed under

Comments