2 minute read

Like a lot of engineers nowadays, I use Docker for my development environment. I have a Windows 11 machine with Windows Subsystem for Linux (WSL) and I use Docker Desktop for Windows. I also use Developer Containers with a volume for the source code to work with my blog, which means the files are not stored on the local file system but in a Docker volume. Occasionally, I need to access the files in the Docker volume for image creation. This post will show you how to access the files in the Docker volume on Windows.

First off, this post assumes you have Windows, either Windows 10 or Windows 11, with WSL and Docker Desktop installed. If you don’t have Docker Desktop installed, you can download it from Docker Hub.

Docker Volume Location

When you use Docker Desktop on Windows, the Docker volumes are stored in the WSL file system. The WSL file system is located at \\wsl$\ on the Windows file system. The Docker volumes are stored in the WSL file system at \\wsl.localhost\docker-desktop-data\data\docker\volumes. You should a folder for each volume you have created in Docker Desktop.

Here is a screenshot of my Docker Desktop volumes.

Docker Volume Location

Here is a screenshot of the WSL file system with the Docker volumes.

Windows Explorer Volume

As you can see, there is a one to one mapping between the Docker Desktop volumes and the WSL file system. If you access these volumes regularly outside of the containers, you might want to rename the folders to something more meaningful.

Accessing the Volumes

If you do access the volumes a lot, you can create a symbolic link to the volumes folder. To do this, open a command prompt or Powershell as an administrator and run the following command.

Note: You can change the C:\Volumes to any folder you want to use.

Command Prompt

1
mklink /D C:\Volumes \\wsl.localhost\docker-desktop-data\data\docker\volumes

PowerShell

1
New-Item -ItemType SymbolicLink -Path "c:\Volumes" -Target "\\wsl.localhost\docker-desktop-data\data\docker\volumes"

File Explorer

If you open up File Explorer, you should see a folder called Volumes in the root of the C:\ drive. This folder is a symbolic link to the Docker volumes. In addition, you can see the Docker folder that contains the volumes, docker-desktop-data, by expanding the Linux file system in the File Explorer. This is only a Windows 11 feature.

Windows Explorer - Linux Docker Desktop Volumes

Wrap Up

In this post, you learned where the Docker volumes are stored when using Docker Desktop on Windows. You also learned how to access the Docker volumes from the Windows file system and create shortcuts to them.

References