How to Point Docker at a Drive other Than C

We are in the process of a new installation of Planning Analytics Workspace at a client. We don’t want the PAW Docker containers to be on the same drive at the Operating System. This post explains how to change the default location for Docker containers – including the PAW containers – to a different hard disk that the C drive.

Assuming that you have successfully installed Docker and run Hello World, then all you need to do is the following:

  • Create a new folder called “Docker” at the root of your secondary drive, e.g. “E:\Docker”
  • Go to “C:\ProgramData\docker\config\” and create a new file called “daemon.json”. Make sure it is in the docker\config folder, not just the docker folder!
  • Here is a download of the file.
  • If you are creating it yourself, paste the following (noting the double backslash!):
"data-root": "e:\\docker"
  • Ensure you change the drive that is referred to in the file to the drive you want to use (so if it should be drive D, rather than E, then make it “d:\\docker”!
  • Restart the Docker service.
  • Note that if Docker does not start properly, check that you have a double backslash in the data-root directory

Test with Hello World

In an elevated Powershell window run the Hello World docker script. Paste:

docker pull hello-world

and, assuming you are connected to the internet, it will run the script and unpack into the new location. Please check that these files are now located correctly.

You might also like

Also in the series