Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker version panics using WSL2 dockerd context #13415

Open
2 of 3 tasks
doctorpangloss opened this issue Apr 19, 2023 · 0 comments
Open
2 of 3 tasks

docker version panics using WSL2 dockerd context #13415

doctorpangloss opened this issue Apr 19, 2023 · 0 comments

Comments

@doctorpangloss
Copy link

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics (not applicable)
  • Diagnostics ID:

Actual behavior

docker version panics with a Linux context.

$ docker version
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x58 pc=0x9a2020]

goroutine 1 [running]:
github.com/docker/cli/vendor/github.com/docker/docker/client.(*Client).ClientVersion(0xc00041a500?)
...

Expected behavior

It should not panic.

Information

dockerd installed within WSL2 directly appears to be working normally. WCOW also works correctly.

Output of & "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check

(not applicable)

Steps to reproduce the behavior

On Windows 2022:

# save yourself the pain of using powershell that no one comprehends
curl -sL https://frippery.org/files/busybox/busybox64.exe -o sh.exe
sh -il

### START INSIDE BUSYBOX
# install ubuntu
wsl --install -d Ubuntu
# reboot
shutdown -r -t 0
# wait for shutdown. you must login interactively to trigger automatic ubuntu install, or
ubuntu2204 install --ui=none
# inside ubuntu, install docker
# i would heredoc this for you but i never remember the syntax for nested heredocs
wsl

### START INSIDE WSL
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Add your user to the Docker group
sudo usermod -aG docker $USER
# enable systemd
sudo tee /etc/wsl.conf <<EOF >/dev/null
[boot]
systemd=true
EOF
# reboot
exit
### END INSIDE WSL
wsl --shutdown

# import the context
wsl docker context export default - | docker context import linux -
docker context use linux
docker version

Observe the error.

Naturally this is a unix socket

$ docker context inspect
[                                                                                                                                           
    {                                                                                                                                       
        "Name": "linux",                                                                                                                    
        "Metadata": {},                                                                                                                     
        "Endpoints": {                                                                                                                      
            "docker": {                                                                                                                     
                "Host": "unix:///var/run/docker.sock",                                                                                      
                "SkipTLSVerify": false                                                                                                      
            }                                                                                                                               
        }, ...
    }                                                                                                                                       
]                                                                                                                                           

It's unclear if this is supported. microsoft/WSL#134 I believe it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant