question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WSL docker: command not found

See original GitHub issue

Actual Behavior

> which docker
docker not found

installed rancher desktop a while ago 1.1 or something. updated to 1.4.1 just now - took a bit, no errors all good. been on kubernetes & containerd, nerdctl all good from wsl & host powershell then turned off kubernetes and switched to dockerd (moby)

docker works on host from powershell, doesn’t in wsl

created the link and all good now

> cd /usr/local/bin && sudo ln -s /mnt/c/Users/username/AppData/Local/Programs/Rancher\ Desktop/resources/resources/linux/bin/docker
> which docker
/usr/local/bin/docker

Steps to Reproduce

in wsl (debian) > which docker

Result

docker not found

Expected Behavior

location of docker

Additional Information

also toggled WSL integration off then on, didn’t create the symlink

once sorted out docker from WSL then VSCode WSL > Remote Container was much faster as expected cause files are all on WSL filesystem. VSCode Remote Container from windows host all just worked, was slow though… hence why i went looking for docker in WSL 😃

Rancher Desktop Version

1.4.1

Rancher Desktop K8s Version

1.23.6 (disabled)

Which container runtime are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 10

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mook-ascommented, Jun 20, 2022

Hi!

We just add the Linux binary to your Windows PATH, and typically the WSL distributions just pick it up from your Windows environment; if that is not working, the two most common issues are:

  • You have a custom ~/.profile / ~/.bashrc etc. in your WSL distribution that clobbered your PATH environment variable
  • You have configured WSL to not append the Windows PATH

If one of those two issues are the cause of it not working for you, there’s not much we can do (other than maybe trying to force-mount our executable there, which seems like a bad idea as it would override any custom versions you may have). If neither is applicable for your environment, we’d be interested in learning what the actual issue is.

Thanks!

0reactions
TheNicholasNickcommented, Jun 26, 2022

yeah - I’ve added to path now higher - all good.

I’m about to setup a new windows 11 machine - will test things there - might be a simple case of updating doesn’t do everything 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ubuntu WSL with docker could not be found - Stack Overflow
The command $ docker could not be found in this WSL 1 distro. We recommend to convert this distro to WSL 2 and...
Read more >
How To Fix docker could not be found With Ubuntu 20.04 WSL ...
Step 4. Open up Docker Desktop, go to Settings->Resources->WSL Integration. You should then check the Ubuntu 20.04 checkbox.
Read more >
Command 'docker' could not be found in this WSL 2 distro error.
I have tried to: Reinstall Docker Desktop; Reboot my computer; Stop services and restart Docker Desktop; Update my WSL 2 distro version to...
Read more >
Docker Desktop WSL 2 backend on Windows
When Docker Desktop starts, go to Settings > Resources > WSL Integration. The Docker-WSL integration will be enabled on your default WSL distribution....
Read more >
the command 'docker-compose' could not be found in this wsl ...
The command 'docker' could not be found in this WSL 2 distro. We recommend to activate the WSL integration in Docker Desktop settings....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found