Change Docker machine location - Windows

后端 未结 12 1328
执笔经年
执笔经年 2020-12-02 05:08

I am using docker toolbox on Windows 7 to run docker. (docker version 1.9.1)

As it turns out, the docker machine creates its VM at C:\\Users\\username\\.docker\\mach

12条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 05:34

    I have had a bit of trouble with any of the solutions above but this is what worked for me:

    • define the MACHINE_STORAGE_PATH environment variable to point to your desired directory/folder.
    • Install docker-toolbox as normal, if this works for you then fine, but for me it was still installing inside .docker directory.
    • To fix this I have then stopped and removed the default machine that was created along with .docker folder from the Users directory.
    • Edited the start.sh script and added the line at the top:

    e.g.

    export MACHINE_STORAGE_PATH=D:\\Docker
    
    • Run the Docker Quickstart Terminal Shortcut, which rebuilt the default machine inside the desired folder

提交回复
热议问题