Change Docker native images location on Windows 10 Pro

前端 未结 7 1886
北荒
北荒 2020-12-29 05:55

This is not a duplicate of Change Docker machine location - Windows

I\'m using docker native, version 1.12.1-stable (build: 7135) on Windows 10 Pro with Hyp

相关标签:
7条回答
  • 2020-12-29 06:25

    There is an easier way to do this: Go to Docker Settings > Advanced > Change "Disk image location" and click "Apply" when prompted. Docker engine will shut down the VM and move it for you to the new location.

    Warning: new location must not be compressed. If it is then Docker will not show you any error, just won't change location.

    0 讨论(0)
  • 2020-12-29 06:26

    None of these steps worked for me. After reboot or a Docker restart, it would move back to the original path. What worked for me is using Junction

    stop docker engine

    create a target folder in the new location:

    mkdir d:\docker\vhd
    

    copy the folder Virtual Hard Disks to the target folder

    rename (and backup) the original folder

    rename “C:\Users\Public\Documents\Hyper-V\Virtual hard disks” “C:\Users\Public\Documents\Hyper-V\Virtual hard disks_backup”
    

    create a hard symbolic link (junction)

    junction.exe "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks" "d:\docker\vhd\Virtual Hard Disks"
    

    start docker engine

    0 讨论(0)
  • 2020-12-29 06:30

    For Those looking in 2020. The following is for Windows 10 Machine:

    1. In the global Actions pane of Hyper-V Manager click Hyper-V Settings…
    2. Under Virtual Hard Disks change the location from the default to your desired location.
    3. Under Virtual Machines change the location from the default to your desired location, and click apply.

    1. Click OK to close the Hyper-V Settings page.
    0 讨论(0)
  • 2020-12-29 06:35

    In 2020 to "Change Docker native images location on Windows 10 Pro" is,

    1. quit docker desktop
    2. open/edit configuration file "C:\ProgramData\Docker\config\daemon.json"
    3. add setting "data-root": "D:\Virtual Machines\Docker"
    4. now start docker desktop
    5. run the command "docker info" to see the setting "Docker Root Dir: D:\Virtual Machines\Docker"
    6. pull docker images e.g.: docker pull mongo
    7. you can find the downloaded images in folder "D:\Virtual Machines\Docker\windowsfilter"
    0 讨论(0)
  • 2020-12-29 06:38

    Edit the Docker Daemon configuration and use "data-root": "D:\\docker" instead of "graph": "/D/docker".
    That will move all the newly downloaded images to D:\docker folder.

    For Old Docker version use graph "graph": "D:\\docker", "graph" has been deprecated.

    0 讨论(0)
  • 2020-12-29 06:43

    Docker Version : 2.2.0.3 (42716)

    1. Right-click on docker icon on desktop tray

    1. Click on Settings

    3 Click on Resources from the left-hand menu then under the Disk Image location click on browse and change the location

    1. Click on apply and restart
    0 讨论(0)
提交回复
热议问题