In order to setup things properly.
#show available distros
wsl --list
Windows Subsystem for Linux Distributions:
YOUR_DISTRO
#Start your distro in WSL2. From command prompt:
wsl -u USERNAME -d YOUR_DISTRO
#within the WSL2 distro, import the exported container:
#docker import FILE_NAME TAG
docker import /mnt/c/foo.tar YOUR_DISTRO:1.0
#after import your image should be available. You can checks this via:
docker image list
Side note 2: WSL2 + NVIDIA vs WSL2 + NVIDIA Container Toolkit
There are two options to get NVIDIA support inside your WSL2 image as described by:
The first one is for
compiling/running CUDA enabled code inside your WSL2 image. The latter is for
running NVIDIA enabled containers inside your WSL2 image. These are not the same and might be confusing. So be sure to follow the right guide.