-
Notifications
You must be signed in to change notification settings - Fork 852
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
WSL 2 docker client cannot reach Docker Desktop via tcp://0.0.0.0:2375 #4321
Comments
It could be a local networking issue. Here are the ip addresses and the route table.
|
You no longer need to use docker for desktop you simply run docker native within WSL 2. Since its now using Hyper-V and has a real kernel. You will need to remove the export DOCKER_HOST from your environment and start the docker daemon using systemctl. Issue should be closed as a non-issue, it works perfectly in Ubuntu-18.04 I've tested it there myself. |
That is partially correct. |
This may be true but I believe the post is talking simply about running a docker container not connecting a database to a docker container running in WSL2. Edit: Typo :) |
I was just explaining why some people still might want to run the docker container in Windows for Docker generally. |
Thanks, Alex and Strike. Indeed, as Alex stated, there are reasons for us to keep using Docker Desktop on Windows. Migrating all containers and volumes from Windows side to native Linux is not a one day job. Docker announced that they would move to WSL2 in future. I guess that there is a day that we will complete the migration. :-) |
I am looking for how to access the docker host running in wsl2 from Windows and even remote desktop like macOS/Linux. |
@fanvinga I have tried that with SysVinit procedure. For that, add For systemd, here are some discussions #994 (comment). |
@Biswa9 Sincerely thank you for your help, I set up the Windows inbound network firewall by the way, now I can use the docker client on my macOS to link the docker host in Windows WSL. |
There now is the docker desktop preview that can work together with a docker daemon running in WSL2 |
Is there a fix for this issue that leaves Docker for Windows running? |
Didn't anyone watch this video about Docker Desktop Integration with WSL? |
I have not spent the time to switch to WSL2
…On Tue, Sep 10, 2019 at 11:03 Biswapriyo Nath ***@***.***> wrote:
Didn't anyone watch this video about Docker Desktop Integration with WSL
<https://www.youtube.com/watch?v=m_PpmELU_PM>?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4321?email_source=notifications&email_token=AANB3KT53VX5ZK2F6XZRGADQI7OO5A5CNFSM4IFFTSY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6L7QWY#issuecomment-530053211>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANB3KWY4YPHM3OAQU6H7ZDQI7OO5ANCNFSM4IFFTSYQ>
.
|
I tried. The accents are extremely difficult to parse out what they're saying. And the host stopping every 45 seconds to dumb down the presentation with quips like "So, magic." don't help AT ALL. |
I still got Cannot connect to the Docker daemon at unix:///var/run/docker.sock. |
Anyone get this working? I have docker running using wsl context and can list my docker images from wsl2 and from windows cmd using 'docker image ls' but when i try view images using eclipse or kitematic from windows it doesn't find any images or containers. I'm trying to connect with localhost:2375. I have checkbox ticked to expose daemon on localhost:2375. I get the feeling kitematic and eclipse are looking for images in default windows context docker. |
I can't even get that special sauce working. What address did you use? I've tried the address in resolv.conf and localhost, didn't work. |
I think i have hit the same issue with running dockcross. Try running docker info as sudo. It seems to be the port that requires sudo privileges. === try setting as follows === sudo usermod -aG docker $USER sudo chown root:docker /var/run/docker.sock |
After a couple of hours I finally solved the error The most common cause are the remains of old Docker approach under WSL 1. For example by set environment variable I assume you have already latest version of Windows 10 and WSL 2 with upgraded linux distro from WSL 1 to WSL 2. How to completely remove Docker from Ubuntu (WSL)?
How to completely remove Docker from Windows?
What next?You should install latest version of Docker Desktop Edge from here and follow steps from official docs. If everything goes fine you should have output from
Some tutorials or advices can confuse you because this time you shouldn't install or config anything related with Docker under your WSL linux distro. It is very important. It should works out of the box after a few of simple steps from Docker docs. Latest working versions (for today):
TL;DR
|
@twistezo This is a good comment, #4321 (comment). You should definitely post this on a blog or something. I have a question for you: Have you tried using Alpine on WSL version 2? My Ubuntu WSL 2 works just fine with the new in-WSL socket Docker Desktop publishes. But for the love of my life I can't get Alpine to connect to Docker Desktop's socket. I wonder about other distros such as Debian. |
@AlexanderAllen no, I haven't tried Alpine. |
For those not running on Ubuntu, @simonferquel over at at Docker for Windows figured out what was my issue. It was not on the WSL end, but on the Docker Desktop end. I needed to install The issue is here docker/for-win#5681 |
Thanks @twistezo your solution works.
|
as @twistezo said:
|
Yup - I'm seeing the same thing on WLinux / Pengwin. If I run a Docker command as my regular user, it says it can't connect to port 2375, but with sudo it works. Interestingly, my regular user is already a member of the docker group, and the docker.sock file is group read-write for the docker group. But something is setting DOCKER_HOST to tcp://0.0.0.0:2375. I have no idea what... there is nothing in my bash startup files that would do this... So in my case, the solution is similar to what you suggest below, except I need to manually set DOCKER_HOST (which I can make permanent in my .profile or similar). Still not a great first experience for folks running Pengwin!
EDIT: There appears to have been a holdover from a previous docker install. I needed to uninstall Docker (via pengwin-setup), and then when I enabled Docker for WSL2 after that, DOCKER_HOST was no longer set. |
@davclark actually the DOCKER_HOST env var problem is the only one that matters: our integration actually creates the group and add the default user to this group for you. I suppose something in Pengwin used to do some magic for making docker desktop work with WSL 1 and thus broke on WSL 2 |
I did every step by the official guide, then this issue occurs. I tried to remove If you guys using OS: Windows 10 build 19041 # WSL Ubuntu
$ docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:25:46 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683 # Windows 10
❯ docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683 |
My steps to work WSL 2 with Docker Desktop on Windows
And then |
In this case, you are not communicating to Docker Desktop via the |
Noticed this issue when going down a similar path and I want to concur with @ctataryn solution. The most recent version of WSL2 and Docker Desktop 2.3.0.2 or greater with the WSL2 featured enabled means you can avoid this problematic tcp port. Recommending closing this ticket as it is no longer relevant as of Docker Desktop 2.3.0.2. |
@artemirq 's Fix worked for me. I don't remember adding that to my |
ISSUE: Cannot connect to the Docker daemon at tcp://127.0.0.1:2375
0. PWOERSHELLwsl -l -v # ALL DISPLAY "2" 1. LINUXunset DOCKER_HOST 2. restart docker
3. LINUXdocker ps |
worked for me! thanks! |
Porting to discussion as this is a relatively straightforward Windows tcp server listening on a port scenario (similar X11 server etc) with no WSL actionable. Tangentially there are various dupes on improvement of WSL2 networking story in general (#4619, others) but those apply to any Windows host use case, not just Docker server. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
In Docker Desktop:
check "Expose daemon on tcp://localhost:2375 without TLS"
In WSL 1:
export DOCKER_HOST=tcp://0.0.0.0:2375
After upgraded to the build 18932 and WSL 2, docker client in WSL won't connect to Docker Desktop engine. Sample error.
Still, the windows cmd side, docker client works as expected.
The text was updated successfully, but these errors were encountered: