How to access docker data from linux wsl2

Viewed 1061

I'm running Docker on windows using WSL2. The docker data directory can be access from windows using this path:

\\wsl.localhost\docker-desktop-data\version-pack-data\community\docker

But when I try to access the same folder from WSL, I couldn't find it.

From the linux terminal, I can find the following directory:

/mnt/wsl/docker-desktop-data/version-pack-data

However, it's empty! it doesn't show community folder or any other folders inside of it!

OS: Windows 11 build 10.0.22000.176 Docker: version 20.10.8, build 3967b7d Docker Desktop: Version 4.0.0

1 Answers

WSL2 mounts to a different path.

The path you looked at on windows, if I'm not wrong, is for docker-desktop with wsl1. This is why the files look different.

The right path on windows will be this path (if you use Ubuntu-20.04 as your subsystem, if not look for the path of the subsystem you use): \\wsl$\Ubuntu-20.04\mnt\wsl\docker-desktop-data

Related