Replies: 34 comments
-
It could be a local networking issue. Here are the ip addresses and the route table.
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
That is partially correct. |
Beta Was this translation helpful? Give feedback.
-
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 :) |
Beta Was this translation helpful? Give feedback.
-
I was just explaining why some people still might want to run the docker container in Windows for Docker generally. |
Beta Was this translation helpful? Give feedback.
-
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. :-) |
Beta Was this translation helpful? Give feedback.
-
I am looking for how to access the docker host running in wsl2 from Windows and even remote desktop like macOS/Linux. |
Beta Was this translation helpful? Give feedback.
-
@fanvinga I have tried that with SysVinit procedure. For that, add For systemd, here are some discussions #994 (comment). |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
There now is the docker desktop preview that can work together with a docker daemon running in WSL2 |
Beta Was this translation helpful? Give feedback.
-
Is there a fix for this issue that leaves Docker for Windows running? |
Beta Was this translation helpful? Give feedback.
-
Didn't anyone watch this video about Docker Desktop Integration with WSL? |
Beta Was this translation helpful? Give feedback.
-
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>
.
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I still got Cannot connect to the Docker daemon at unix:///var/run/docker.sock. |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
@AlexanderAllen no, I haven't tried Alpine. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Thanks @twistezo your solution works.
|
Beta Was this translation helpful? Give feedback.
-
as @twistezo said:
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
My steps to work WSL 2 with Docker Desktop on Windows
And then |
Beta Was this translation helpful? Give feedback.
-
In this case, you are not communicating to Docker Desktop via the |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
@artemirq 's Fix worked for me. I don't remember adding that to my |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
worked for me! thanks! |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions