By default Docker sets up MobyLinuxVM and downloads and installs docker image on your C:\ drive. For most people this is not ideal, as this is our main application drive and can be limited in space. Especially if you are using Docker on a laptop with a small hard drive. So you will probably want to use an different drive to your C:\ drive.
It is a very straight forward task to perform.
First of all, you need to stop your docker containers using the docker stop [Container Name] command. For a list of all your docker images, run the command: docker images –all.
Then type “Hyper-V Manager in the taskbar search box and run it. Select your PC in the left hand pane. Right-click on the correct virtual machine which by default is called MobyLinuxVM. Select “Turn Off”. Right-click on the Virtual Machine and select “Move”. Follow the on-screen prompts to move your VM.
Now open Docker Settings and select Daemon. Switch from Basic to Advanced. Edit the JSON so that it looks like:
Click on Apply to apply your change. In the JSON above, the graph property is the location where your docker images will be placed by default from now on.
If you are new to Docker and would like to learn more on how to use Docker on Windows then you can buy the book Docker on Windows published by Packt.
Author Elton Stoneman guides you through getting started with docker on Windows, packaging and running applications as docker containers, developing dockerised .NET and .NET Core Applications, pushing and pulling images from docker registries, adopting container-first solution design, organising distributed solutions with Docker Compose, administering and monitoring dockerised solutions, understanding the security risks and benefits of docker, powering a continuous deployment pipeline with docker, debugging and instrumenting application containers, and guidance for implementing docker by containerising what you know.