docker / desktop-linux

Bug reports for Docker Desktop for Linux
https://docs.docker.com/desktop/linux/
81 stars 6 forks source link

`--network host` not resolving to Docker Desktop host #87

Open ReubenFrankel opened 2 years ago

ReubenFrankel commented 2 years ago

Expected behavior

Actual behavior

image

Information


I've been having this problem for a while now, so isn't version-specific AFAIK. I am aware Docker Desktop runs a Linux VM, so (I think) --network host is resolving to the VM network instead of the host OS network. I was under the impression that this should work after reading this blog post - specifically:

Seamless plumbing into the host OS giving containers access to the filesystem and networking

or I might just be missing something fundamental. :sweat_smile:

Steps to reproduce the behavior

  1. python -m http.server 8080
  2. docker run --rm --network host alpine sh -c 'apk add curl -q && curl -sv -o /dev/null http://localhost:8080'
docker-robott commented 1 year ago

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

ReubenFrankel commented 1 year ago

/remove-lifecycle stale

hissssst commented 1 year ago

I have exactly the same issue

darkship commented 1 year ago

I have this issue too since I use docker desktop with docker compose.

The easiest and recommended way to get Docker Compose is to install Docker Desktop.