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”.
  • 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.
  • Restart the Docker service.
  • Note that if Docker does not start properly, check that you have a double backslash in the data-root directory
  • Run Hello World in an elevated Powershell window. This will regenerate the Hello World docker container in the new location.
  • Check that it works properly and that the files are now located in the new location.

If you like this post, please spread the love…

About John

Managing Director of Infocube. We are a management accounting consultancy that specialises in Business Analytics.

One comment on “How to Point Docker at a Drive other Than C

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.