Change .docker directory on Windows

The standard path on Windows where Docker puts stuff is:

C:\Users\<USER>\.docker

We need to put it here:

  • Getting error while runnig neo4j-mazerunner project
  • Dockerfile not using cache in RUN composer install command
  • What are different options to deliver docker images
  • How do I avoid download images on all docker hosts which are part of my swarm?
  • Send a command into a running docker
  • Docker-Mongodb - How to connect to the mongo image in local(windows)
  • D:\Docker
    

    We couldn’t find any info about where or how to change that setting. Any hint appreciated, thanks!

  • Flask app doesn't retrieve data from same database as unit tests
  • Amazon container registry login
  • Debugging staging docker compose server with pycharm
  • Best practice for building docker for Python - requirements file OR install individually
  • Parse a variable with the result of a command in DockerFile
  • cannot connect to container with docker-compose
  • 2 Solutions collect form web for “Change .docker directory on Windows”

    One solution that works for us is creating a symbolic link:

    mklink /J "C:\Users\<USER>\.docker" "D:\Docker"
    

    But it’s not what we call a clean solution.

    (All credit for the question & this answer goes to IMM0rtalis.)

    You simply can define the environment variable HOME before launching a new boot2docker or docker machine session.

    set HOME=D:\docker
    

    (Add it to your user environment variables if you want it to persists across CMD sessions)

    Those tools will look for any config in $HOME/.xxx

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.